SavefileArchive
USD/IDR ...
|
BTC ...
|
ETH ...
|
GOLD/gram ...
Terbaru
SavefileArchive — Tutorial coding, tips programming, dan dunia musik untuk developer & pecinta musik Indonesia

config centos httpd to multi site

 

To configure Apache HTTP Server (httpd) on CentOS to support multiple websites, you can use the VirtualHost directive in the Apache configuration file.

The VirtualHost directive allows you to specify a separate configuration for each website, such as the server name, the document root, the log files, and the virtual aliases.

To configure Apache HTTP Server on CentOS to support multiple websites, follow these steps:

  1. Open the Apache configuration file, which is typically located at /etc/httpd/conf/httpd.conf, using a text editor, such as vi or nano.
  2. Locate the VirtualHost directive and add a separate VirtualHost block for each website you want to host. For example:
<VirtualHost *:80> ServerName www.example.com DocumentRoot /var/www/html/example.com ErrorLog /var/log/httpd/example.com-error.log CustomLog /var/log/httpd/example.com-access.log common </VirtualHost> <VirtualHost *:80> ServerName www.anothersite.com DocumentRoot /var/www/html/anothersite.com ErrorLog /var/log/httpd/anothersite.com-error.log CustomLog /var/log/httpd/anothersite.com-access.log common </VirtualHost>
  1. Save the configuration file and exit the text editor.
  2. Restart the Apache HTTP Server using the following command:
sudo systemctl restart httpd

After completing these steps, Apache HTTP Server will be configured to support multiple websites, and you can access each website using its corresponding server name.