-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathServerCreationPHP
46 lines (40 loc) · 1.65 KB
/
ServerCreationPHP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
Step by step-Server Creation
1. Get an AWS account
2. Sign into AWS account
3. Go to the EC2 tab
4. Launch an instance
5. Select an Ubuntu Server 16.04 LTS
6. Select the free tier eliglble option
7. Launch the instance
8. Configure Security Rules for instance
a. Allow HTTP, HTTPS and SSH inbound
b. Allow all traffic out
9. SSH into the server using the .pem file required by Amazon
10. Install Apache2 (sudo apt-get install apache2)
a. Start service if it's not already started (sudo service apache2 start)
11. Install MongoDB
a. sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
b. echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
c. sudo apt-get update
d. sudo apt-get install -y mongodb-org
e. cd /lib/systemd/system/
f. vim mongod.service
i. Paste the following into file:
[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target
Documentation=https://docs.mongodb.org/manual
[Service]
User=mongodb
Group=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf
[Install]
WantedBy=multi-user.target
g. systemctl daemon-reload
h. systemctl start mongod
i. systemctl enable mongod
12. Start a Mongo session (test if working)
a. Simply type mongo into the console
b. To exit simply type exit
13. Install Mongo-PHP driver
a. sudo apt-get install php-mongodb