On OS 2.xx i had to set virtualhost in apache .conf files, even for NAS web interface.
Today i updated to OS 5, and have the same problem. Don’t have much time and experience to solve it right now.
It’s a pitty, that WD don’t provide a guide for setting and using WP app.
nasAdmin listens to 80 port and uses Apache as a proxy on 8000 port.
# netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:8000 0.0.0.0:* LISTEN 14597/httpd
tcp6 0 0 :::8543 :::* LISTEN 4803/nasAdmin
tcp6 0 0 :::80 :::* LISTEN 4803/nasAdmin
8543 port used for secure connection, as i can understand.
Apache configured to listen only to 127.0.0.1:8000.
# cat /usr/local/apache2/conf/extra/ports.conf
nasAdmin has config at
httpPort = 81
httpsPort = 8543
proxyPort = 8000
So i can change port 80 to 81 (as you can see).
And by adding
/usr/local/apache2/conf/extra/mysite.conf file i can add a virtual host with 80 port.
BUT. When i’m trying to change existing apache2
.conf files, some how the server overwrites my updates after
apache restart web, so i can’t configure a virtualhost for NAS webGUI. <— That is not true. After some tests i can say, that i can change main conf files, go to UPD3.
And i have some problem with php fastCGI, as i can understand. Only static files (not php) can be reached via custom virtualhost (WordPress).
Well, i can change apache conf files.
First, i had to add
<VirtualHost> directive at
httpd.conf. And i had to delete
/usr/local/apache2/conf/mods-enabled/custom.conf file, but included it’s entry at
Than, i deleted
/usr/local/apache2/conf/mods-enabled/proxy_php-fpm.conf and included its entry at
Second, i had to add new pool at
/etc/php/php-fpm.conf. And there is a problem. Some how configuration with unix socket doesn’t work. It took me one day to get solution with TCP channel. May be i do something wrong with unix socket.
Third, i edited
mysite_ssl.conf file with something like this (feel free to criticise):
<Proxy "fcgi://127.0.0.1:9000/" enablereuse=on max=10>
ProxyPassMatch ^/WordPress/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/WordPress/$1
mysite.conf file contains only redirect to https:
Redirect / https://mysite.expl/
After that i can reach
http://mysite.expl/info.php. (Do you understand, that i changed my
hosts file to resolve domain name for testing?)
To reach WP from outside someone have to enable port forwarding at his router.