我意识到已经有多个类似的问题,但我似乎找不到一个答案来明确我需要做什么:
我有一个DigitalOcean液滴,用于烧瓶应用。我现在想有一个WordPress博客在/blog。我浏览了DigitalOcean's WordPress setup instructions,但没有说明如何修改Apache .conf
文件以指向WordPress index.php
文件。你知道吗
我尝试将Alias
添加到我的.conf
文件中,但它不起作用。当我现在转到/blog
时,我看到默认的Apache“Itworks!”第页。但是,如果我转到www.rhymecraft.guru/blog/wp-admin
,它会加载管理面板。你知道吗
(注意,我将WordPress安装到了/var/www/html
。)
WSGIDaemonProcess rhymecraft.guru processes=2 threads=15 display-name=%{GROUP}
WSGIProcessGroup rhymecraft.guru
<VirtualHost *:80>
ServerName www.rhymecraft.guru
ServerAlias rhymecraft.guru
ServerAdmin xxxx@gmail.com
Alias /blog /var/www/html
WSGIScriptAlias / /var/www/rhymecraft/server/rhymecraft.wsgi
DocumentRoot /var/www/rhymecraft/server
Alias /robots.txt /var/www/rhymecraft/server/robots.txt
Alias /favicon.ico /var/www/rhymecraft/server/robots.txt
<Directory /var/www/rhymecraft/server>
Order allow,deny
Allow from all
</Directory>
Alias /static /var/www/rhymecraft/server/static
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.rhymecraft.guru [OR]
RewriteCond %{SERVER_NAME} =rhymecraft.guru
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
ServerName www.rhymecraft.guru
ServerAlias rhymecraft.guru
ServerAdmin xxxx@gmail.com
Alias /blog /var/www/html
WSGIScriptAlias / /var/www/rhymecraft/server/rhymecraft.wsgi
DocumentRoot /var/www/rhymecraft/server
Alias /robots.txt /var/www/rhymecraft/server/robots.txt
Alias /favicon.ico /var/www/rhymecraft/server/robots.txt
<Directory /var/www/rhymecraft/server>
Order allow,deny
Allow from all
</Directory>
Alias /static /var/www/rhymecraft/server/static
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/rhymecraft.guru/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/rhymecraft.guru/privkey.pem
</VirtualHost>
.conf
文件中什么是启用WordPress。除了OP之外,唯一一个发布答案的人是建议使用子域而不是子目录来承载博客的方法。你知道吗
我成功了。你知道吗
我需要做两件事:
Alias /blog /var/www/html
行。一开始我只把它放在端口80(普通HTTP流量)条目中,但忘了把它放在端口443(HTTPS流量)条目中。index.html
目录中的默认Apache/var/www/html
文件。index.php
文件。你知道吗相关问题 更多 >
编程相关推荐