How to Install and Configure Nginx server in ubuntu16.04 LTS

1. sudo vi /etc/environment
2. sudo apt-get update
3. sudo apt-get upgrade
4. sudo apt-get install nginx
5. sudo apt-get install mysql-server
6. sudo apt-get install python-pip
7. sudo apt-get install python3-pip
8. sudo -H pip install –upgrade pip
9. sudo -H pip install virtualenv virtualenvwrapper
10. sudo -H pip3 install –upgrade pip
11. sudo -H pip3 install virtualenv virtualenvwrapper
12. If you are using Python 3 and the pip3 command, you will have to add an additional line to your shell initialization script as well: echo “export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3” >> ~/.bashrc
13. Regardless of which version of Python you are using, you need to run the following commands: echo “export WORKON_HOME=~/Env” >> ~/.bashrc
14. echo “source /usr/local/bin/” >> ~/.bashrc
15. source ~/.bashrc
16. Create your first virtual environment with the name of your first site or project by typing: mkvirtualenv firstsite
17. pip install django
18. we can create our first sample project by typing: startproject firstsite
19. cd ~/firstsite
20. ~/firstsite/ migrate
21. ~/firstsite/ createsuperuser
22. ~/firstsite/ A Django project management script.
23. ~/firstsite/firstsite/: The Django project package. This should contain the,,, and files.
24. ~/firstsite/db.sqlite3: The SQLite database file used to store your site information.
25. sudo vi ~/firstsite/firstsite/
26. STATIC_URL = ‘/static/’
STATIC_ROOT = os.path.join(BASE_DIR, ‘static/’)
27. ~/firstsite/ collectstatic

How to Install Apache on CentOS 7

1) First, clean-up yum: sudo yum clean all
2) As a matter of best practice we’ll update our packages: sudo yum -y update
3) Installing Apache is as simple as running just one command: sudo yum -y install httpd
4) And then start Apache: sudo systemctl start httpd
5) Be sure that Apache starts at boot: sudo systemctl enable httpd
6) To check the status of Apache: sudo systemctl status httpd
7) To stop Apache: sudo systemctl stop httpd