Apache Conf
Apache Conf
</body>
</html>
## curl http://example.node1.com
if this comand is running so your apache server is ok.
=============================================================================
=============================================================================
## cd /var/www
# mkdir google
# mkdir yahoo
# cd google
# echo "this is my google page" > google.html
# cd yahoo
# echo "this is my yahoo page" > yahoo.html
# cat yahoo.html
# pages are ready then edit main file.
# vim /etc/httpd/conf/httpd.conf
============================================
<VirtualHost 192.168.65.133:80>
ServerAdmin [email protected]
ServerName example.node1.com
DocumentRoot /var/www/html
</VirtualHost>
<VirtualHost 192.168.65.133:80>
ServerAdmin [email protected]
ServerName google.node1.com
DocumentRoot /var/www/google
DirectoryIndex google.html
ServerAlias google.com
CustomLog "logs/google_access.log" combined
ErrorLog "logs/google_error.log"
</VirtualHost>
<VirtualHost 192.168.65.133:80>
ServerAdmin [email protected]
ServerName yahoo.node1.com
DocumentRoot /var/www/yahoo
DirectoryIndex yahoo.html
ServerAlias yahoo.com
CustomLog "logs/yahoo_access.log" combined
ErrorLog "logs/yahoo_error.log"
</VirtualHost>
<Directory /var/www/google>
require all granted
</Directory>
<Directory /var/www/yahoo>
require all granted
</Directory>
============================================
# systemctl restart httpd
# httpd -t
# vim /etc/hosts
192.168.65.133 example.node1.com
192.168.65.133 google.node1.com
192.168.65.133 yahoo.node1.com