Created
March 2, 2016 18:13
-
-
Save wicky-andrian/4b612048cb9c99ff0c5c to your computer and use it in GitHub Desktop.
setup virtual host on apache (Ubuntu 14.04)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## copy default.conf on /etc/apache2/sites-available/000-default.conf (or something like this) | |
| ## or just make it new conf | |
| $ touch exaple.conf | |
| ## and open example.conf | |
| $ sudo nano example.conf | |
| ## Paste code this bellow | |
| <VirtualHost *:80> | |
| ServerAdmin admin@example.com | |
| ServerName example.com | |
| ServerAlias www.example.com | |
| DocumentRoot /var/www/example.com/public_html | |
| ErrorLog ${APACHE_LOG_DIR}/error.log | |
| CustomLog ${APACHE_LOG_DIR}/access.log combined | |
| </VirtualHost> | |
| ## save press (ctrl+x) if u dont know this hehe | |
| ## and active that conf | |
| $ sudo a2ensite example.conf | |
| $ sudo service apach2 restart | |
| ## dont forget to check host for setting new ip or | |
| $ sudo nano /etc/hosts | |
| ## this for new setup domain or what you need for that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment