2014-01-29 44 views
0

我在ubuntu服務器12.04.3 LTS上部署wordpress。WordPress的ubuntu服務器上錯誤地重定向

我在/etc/apache2/ports.conf創建的虛擬主機

了NameVirtualHost *:82 聽82

在我的網站可用的,我有一個WordPress的文件如下:

<VirtualHost *:82>                                                               
    ServerAdmin [email protected] 

    DocumentRoot /home/rex/sites/wordpress 
    <Directory /> 
     Options FollowSymLinks 
     AllowOverride None 
    </Directory> 
    <Directory /home/rex/sites/wordpress> 
     Options FollowSymLinks 
     AllowOverride 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 

    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> 

</VirtualHost> 

在我的〜/網站/ WordPress的/ htaccess的,我有以下幾點:

# BEGIN WordPress 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase/
RewriteRule ^index\.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
</IfModule> 

# END WordPress 

我遇到的問題是,當我在瀏覽器中輸入我的服務器IP和端口號時,192.168.1.61:82,我被重定向到192.168.1.61,並且錯誤消息顯示「禁止您無權訪問/在這臺服務器上。「

任何想法?謝謝。

回答

0

嘗試添加ServerAdmin線以下這一權利:

ServerName 192.168.1.61 
+0

我想這一點,同樣的結果,重定向到192.168.1.61 – user2730490

+0

@ user2730490你確定WordPress是不負責重定向? –

+0

我認爲這是由wordpress造成的,因爲當我在〜/ sites/wordpress中放置一個空的index.php文件時,它就起作用了。 – user2730490