duanque19820925 2017-12-18 09:58 采纳率: 0%
浏览 20

在ubuntu @ ec2中在虚拟主机上设置wordpress时出现问题

Trying to setup Wordpress on one of the virtual hosts on my ubuntu ec2 instance. Facing two issues.

  1. mydomain.com is redirecting to mydomain.com/wordpress, when I wanted Wordpress to be rendered on mydomain.com.
  2. The themes are not displaying correctly, whether in mydomain.com/wordpress or while installing in wp-admin. I can see the themes are present in /var/lib/wordpress/wp-content/themes.

Browser console shows following:

Resource interpreted as Stylesheet but transferred with MIME type text/html: "mydomain.com/wordpress/wp-content/themes/twentysixteen/genericons/genericons.css/?ver=3.4.1".
Resource interpreted as Stylesheet but transferred with MIME type text/html: "mydomain.com/wordpress/wp-content/themes/twentysixteen/style.css/?ver=4.4.2".
?ver=20160816:1 Uncaught SyntaxError: Unexpected token <
?ver=20160816:1 Uncaught SyntaxError: Unexpected token <

Context:

1) Installed Wordpress by following: https://help.ubuntu.com/community/WordPress.

2) Files in /var/www/mydomain.com/public_html/:

index.php:
    <?php
    define('WP_USE_THEMES', true);
    require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );

.htaccess:
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

wordpress/ -> /usr/share/wordpress

3) Content of /etc/apache2/sites-enabled/mydomain.com.conf:

ServerAdmin webmaster@localhost
    ServerName mydomain.com
    ServerAlias www.mydomain.com
DocumentRoot /var/www/mydomain.com/public_html

<Directory "/var/www/mydomain.com/public_html">
    AllowOverride All
</Directory>

Alias /wp-content /var/lib/wordpress/wp-content

<Directory /usr/share/wordpress>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

<Directory /var/lib/wordpress/wp-content>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

4) Content of /etc/wordpress/config-mydomain.com.php:

<?php
# Created by /usr/share/doc/wordpress/examples/setup-mysql 
#...mysql entries...
define('WP_CONTENT_DIR', '/var/lib/wordpress/wp-content');
?>

5) Entries in mydomain.com/wordpress/wp-admin/options-general.php:

Wordpress address: mydomain.com/wordpress
Site address: mydomain.com
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
    • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
    • ¥15 如何处理复杂数据表格的除法运算
    • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
    • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
    • ¥200 uniapp长期运行卡死问题解决
    • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
    • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
    • ¥15 乘性高斯噪声在深度学习网络中的应用
    • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决