为完美的 Wordpress 环境配置 VirtualHost

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15980427/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 19:13:01  来源:igfitidea点击:

Configure VirtualHost for a perfect Wordpress Environment

wordpressapache2virtualhosthttpd.confrackspace

提问by Locke

I'm trying to install wordpress in a Cloud Server with rackspace.

我正在尝试在带有机架空间的云服务器中安装 wordpress。

But my lack of knowledge in server configuration (LAMP , etc) is making me do a lot of miss configurations .

但是我对服务器配置(LAMP 等)的缺乏了解使我做了很多未完成的配置。

First I think the .httaccess is not allow. Second the update Wordpress and plugins featured is not allow Third may be more numbers...

首先我认为 .httaccess 是不允许的。第二个更新 Wordpress 和插件是不允许的 第三个可能是更多的数字......

let me show my virtualhost file:

让我展示我的虚拟主机文件:

    <VirtualHost *:80>
  # Admin email, Server Name (domain name) and any aliases
  ServerAdmin [email protected]
  ServerName  my.com
  ServerAlias www.my.com


  # Index file and Document Root (where the public files are located)
  DirectoryIndex index.html, index.php
  DocumentRoot /home/devdreams/domains/my.com/public


  # Custom log file locations
  LogLevel warn
  ErrorLog  /home/devdreams/domains/my.com/log/error.log
  CustomLog /home/devdreams/domains/my.com/log/access.log combined

    <Directory />
      Options FollowSymLinks
      AllowOverride All
      Order deny,allow
      Deny from all
      Satisfy all
    </Directory>

  AccessFileName .htaccess


    <Directory /home/devdreams/domains/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        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>

    Alias /doc/ "/usr/share/doc/"

    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

    LoadModule rewrite_module modules/mod_rewrite.so


</VirtualHost>

Could somebody help me configure my VH for a wordpress environment

有人可以帮我为 wordpress 环境配置我的 VH

thaaks

塔克斯

回答by Tony

Your .htaccess will not work because you have AllowOverride None, change that to AllowOverride All

您的 .htaccess 将无法使用,因为您已将其AllowOverride None更改为AllowOverride All

In terms of being able to update Wordpress and the plugins you will need to change the ownership of the files/directories to the user that is running the webserver. For example: chown -R apache:apache /home/devdreams/domains/

就能够更新 Wordpress 和插件而言,您需要将文件/目录的所有权更改为运行网络服务器的用户。例如: chown -R apache:apache /home/devdreams/domains/