Multi-sites and 404 of Permalinks issue

Initially, I was going to write something about using Modelica for simulations of HVAC systems. But I have been assigned to other tasks. So, I just share some experience about connecting one IP with multi-domains here.

My server has been running a website already when the server is set for running multi-sites, the original files are reordered for a clean view. I used the method for adding the site to Nginx firstly. But it did not work. While searching for solutions, I realized that my server is mainly using Apache, the easier way was to set up virtual hosts. So the codes added to /etc/httpd/conf/http.conf are as follows:

<VirtualHost *:80>
ServerAdmin example@example.com
DocumentRoot /var/www/html/a
ServerName www.a.com
ErrorLog /var/log/httpd/a/error_log
CustomLog /var/log/httpd/a/access_log common
</VirtualHost>

<VirtualHost *:80>
ServerAdmin example@example.com
DocumentRoot /var/www/html/b
ServerName www.b.com
ErrorLog /var/log/httpd/b/error_log
CustomLog /var/log/httpd/b/access_log common
</VirtualHost>

Then, I created another database for the other site. Unfortunately, my own site failed to work while opening blogs. The blogs can only work when permalinks are default. Then, the problem is solved by enabling the “mod_rewrite” for the folders that contain WordPress files thanks to Don.

Adding the following codes to /etc/httpd/conf/http.conf.

<Directory "/var/www/html/***">
Order allow,deny
Allow from all
AllowOverride All
</Directory>

 

Bibliography:

https://yq.aliyun.com/ziliao/48568

https://community.rackspace.com/products/f/48/t/3180