Last active
December 29, 2015 23:19
-
-
Save pasupulaphani/7742158 to your computer and use it in GitHub Desktop.
Configure Apache
This file contains 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
### /etc/hosts #### | |
# Add to hosts. 192.168.0.13 is your server ip (ifconfig) | |
192.168.0.13 www.site2.com site2.com | |
192.168.0.13 www.site3.com site3.com |
This file contains 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
### Make sure that NameVirtualHost is set properly. (check ports.conf in exists) | |
# This is the name of the main Virtual Host, your main web-server name. | |
# This could also be replaced by the server's IP address or by the * character. | |
# But if you have multiple sites with names then * will conflict. | |
NameVirtualHost *:80 | |
# Listen to all requests from port 80 and 443(https) | |
Listen 80 | |
Listen 443 | |
# Create individual hosts in sites-available | |
<VirtualHost *:80> | |
# Basic setup | |
ServerAdmin [email protected] | |
ServerName site2.com | |
ServerAlias www.site2.com | |
DocumentRoot /home/phani/mysites/site2 | |
# HTML documents, with indexing. | |
<Directory /home/phani/mysites/site2> | |
Options +Includes | |
</Directory> | |
# CGI Handling | |
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ | |
<Location /usr/lib/cgi-bin> | |
Options +ExecCGI | |
</Location> | |
# Logfiles | |
ErrorLog /home/phani/mysites/site2/error.log | |
CustomLog /home/phani/mysites/site2/logs/access.log combined | |
</VirtualHost> | |
<VirtualHost *:80> | |
# Very basic setup | |
ServerAdmin [email protected] | |
ServerName site3.com | |
ServerAlias www.site3.com | |
DocumentRoot /home/phani/mysites/site3 | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment