dsxsou8465 2012-12-23 10:44
浏览 184
已采纳

在aws ec2中设置wordpress服务器弹性ip后,我的wordpress无法请求静态文件

I build a wordpress in aws EC2,everything goes well until I bind a Elastic IP to my wordpress server. The question is wordpress static file request is still the default aswec2 public dns, but I can see the page without css/js.

Web server:apache2;Database: aws RDS(mysql);php version:5.3.10;My wordpress address:www.aoaostudio.com ;

Because before I bind a Elastic IP, I visit the aws public dns:ec2-***-.ap-northeast-1.compute.amazonaws.com,my wordpress blog is ok!

I feel my apache2 configuration maybe wrong, the configuration file is as follows:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName www.aoaostudio.com
        DocumentRoot /var/www/wordpress
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/wordpress>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>
</VirtualHost>

I have no idea about php, maybe my question is fool, but I hope someone can give a help.

  • 写回答

1条回答 默认 最新

  • douba2705 2012-12-23 11:27
    关注

    You probably installed wordpress while you didn't have the elastic IP, so Wordpress remembered your URL as ec2-...

    There is a tutorial for changing the URL of your Wordpress installation here. Follow it, using www.aoaostudio.com as your URL.

    Basically, what you need to do is to add these lines at the top of the functions.php file, right after the opening <?php tag:

    update_option( 'siteurl', 'http://example.com' );
    update_option( 'home', 'http://example.com' );
    

    Then just load the admin login page a few times, and the URLs should update. It's very important that after all URLs are updated, you remove the code.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

问题事件

  • 专家修改了标签 8月18日