0
我想用Linux實例在Google Cloud上託管一個WordPress網站。 目前已經運行在80端口的網站,我想比80 其他任何端口上承載我的新網站,我已經改變以下ports.conf和mywebsite.conf實現這一如何從80以外的其他端口訪問apache2(來自GCP的Linux)的網站?
/etc/apache2/ports.conf
現有代碼
Listen 80
新代碼
Listen 80
Listen 8080
我創建以下文件與虛擬主機
/etc/apache2/sites-available/mywebsite.conf
與代碼
<VirtualHost *:8080>
ServerAdmin [email protected]
DocumentRoot /var/www/mywebsite.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mywebsite.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
做了這些改變之後,我只是進行了一些命令如下
$sudo a2ensite mywebsite.conf
$service apache2 restart
但是,當我打我的網站url爲http://IPAdressOfServer:8080/服務器正在返回ERR_CONNECTION_TIMED_OUT。
究竟我需要做些什麼才能做到這一點?
是的。這一個爲我工作。非常感謝。 –