AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[wordpress-mu](server)

Martin Hope
Maestro223
Asked: 2021-01-08 19:04:26 +0800 CST

Ubuntu 20.04 LAMP 和 WP 多站点的 OpenSSL 配置

  • 0

问题: 如何将 1 个 OpenSSL 证书应用于 html 目录中的所有网站? 问题:访问时https://localhost.site1.com或https://localhost.site2.com只显示index.html位于/var/www/html/index.html因为default-ssl.conf文档根目录是/var/www/html/

我有 2 个 wordpress 多站点(和其他站点)位于/var/www/html/:

/var/www/html/site1.com

和

/var/www/html/site2.com

在我的default-ssl.conf我有:

<IfModule mod_ssl.c>
<VirtualHost _default_:443>
    ServerAdmin [email protected]
    ServerName localhost
    ServerAlias localhost

    DocumentRoot /var/www/html/
    
    ErrorLog ${APACHE_LOG_DIR}/localhost.error.log
    CustomLog ${APACHE_LOG_DIR}/localhost.access.log combined

            SSLEngine on
    SSLCertificateFile  /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
    
    #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
    <FilesMatch "\.(cgi|shtml|phtml|php)$">
            SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory /usr/lib/cgi-bin>
            SSLOptions +StdEnvVars
            DirectoryIndex index.php
            AllowOverride All
            Order allow,deny
            Allow from all
            Require all granted
    </Directory>

    #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
    #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
    #   "force-response-1.0" for this.
      BrowserMatch "MSIE [2-6]" \
            nokeepalive ssl-unclean-shutdown \
            downgrade-1.0 force-response-1.0

</VirtualHost>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

在我的/etc/hosts文件中,我有:

127.0.1.1   excalibur
127.0.0.1   localhost 
127.0.0.1   localhost.site1.com *.localhost.site1.com   # mainsite url
127.0.0.1   subsite-a.localhost.site1.com   
127.0.0.1   subsite-b.localhost.site1.com
127.0.0.1   subsite-c.localhost.site1.com

127.0.0.1   localhost.site2.com *.localhost.site2.com   # mainsite url

site1.com 的虚拟主机包含:

    <VirtualHost *:80>

    ServerName localhost.site1.com 
    ServerAlias www.localhost.site1.com
    
    # If this is the default configuration file we can use: 'ServerName localhost' or also 'ServerAlias localhost'.

    ServerAdmin [email protected]

    ErrorLog ${APACHE_LOG_DIR}/localhost.site1.com.error.log
    CustomLog ${APACHE_LOG_DIR}/localhost.site1.com.access.log combined

    DocumentRoot /var/www/html/site1.com
    
    <Directory /var/www/html/site1.com>
        Options None FollowSymLinks
        # Enable .htaccess Overrides:
        AllowOverride All
        DirectoryIndex index.php
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>

    <Directory /var/www/html/site1.com/wp-content>
        Options FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
    
    
   SSLEngine on
   SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
   SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key

</VirtualHost>

site2.com 的虚拟主机包含:

    <VirtualHost *:80>

    ServerName localhost.site2.com
    ServerAlias www.localhost.site2.com
    
    # If this is the default configuration file we can use: 'ServerName localhost' or also 'ServerAlias localhost'.

    ServerAdmin [email protected]

    ErrorLog ${APACHE_LOG_DIR}/localhost.site2.com.error.log
    CustomLog ${APACHE_LOG_DIR}/localhost.site2.com.access.log combined

    DocumentRoot /var/www/html/site2.com
    
    <Directory /var/www/html/site2.com>
        Options None FollowSymLinks
        # Enable .htaccess Overrides:
        AllowOverride All
        DirectoryIndex index.php
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>

    <Directory /var/www/html/site2.com/wp-content>
        Options FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>
    
   SSLEngine on
   SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
   SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
   
</VirtualHost>

有小费吗?

openssl wordpress-mu
  • 1 个回答
  • 84 Views
Martin Hope
Maytha8
Asked: 2020-01-26 22:16:32 +0800 CST

如何在 MacOS 10.15 上创建通配符子域?

  • 0

我已经在我的计算机上进行了设置localhost/~<username>,~/Sites并且我正在使用/etc/apache2/extra/httpd-vhosts.conf它来制作自定义测试域。如何添加 DNS 通配符域?( *.dev.server)

我已经在 ~/Sites/Wordpress (as ) 上设置了 Wordpress 多站点网络wordpress.server,每当我创建一个站点时,它都不起作用。我如何让它发挥作用?

httpd-vhosts.conf

<VirtualHost *:80>
    DocumentRoot "/Users/<username>/Sites/Wordpress"
    ServerName wordpress.server
    ServerAlias www.wordpress.server
</VirtualHost>

/etc/hosts

127.0.0.1    wordpress.server
127.0.0.1    www.wordpress.server

谢谢!

mac-osx wordpress apache-2.4 wordpress-mu
  • 1 个回答
  • 1705 Views
Martin Hope
David L.
Asked: 2016-05-21 14:36:07 +0800 CST

是什么导致上传时 wordpress 文件为空错误?

  • 0

当我尝试在 wordpress 中上传任何内容时,我似乎无法弄清楚为什么会得到以下信息……对于媒体上传和 wordpress 导入 xml:

“抱歉,出现错误。文件为空。请上传更多内容。此错误也可能是由 php.ini 中禁用上传或 post_max_size >定义为小于 php.ini 中的 upload_max_filesize 引起的。 "

似乎很少有关于如何通过 nginx/php-fpm 在线解决此问题...其中大部分是关于 php.ini max configs 或 chmod,其中...在我的设置中post_max_size足够大以及(以及超时)......并且 chmod/chown 似乎对于使用单独的 php 池是正确的。也许有人可以对此做出正面或反面?upload_max_filesize/etc/php5/fpm/php.ini

这是我的设置:

  • Cloudflare(已关闭)到浮动 IP
  • Digitalocean 浮动 IP 到 droplet
  • Droplet 是带有 nginx 的 Ubuntu 14.04,使用 php-fpm 并为每个 wordpress ms 安装创建池(x4 atm)
  • SSL with Let's encrypt 用于每个 wpms 安装
  • Chmod 755 用于站点根目录中的所有 wpms 目录
  • chmod 644 用于每个站点根目录中的所有 wpms 文件
  • chmod 660 用于 wp-config.php
  • chown 每个 php5-fpm 池用户在他们自己的站点根目录中的所有文件/目录,例如:chown -R example1:example1 /home/example1/*
  • Wordpress 是其 nginx conf 根目录下的一个目录。例如/home/example1/app/wordpress_files_here
  • php.ini 已使用定义的目录(/home/tmp/)启用上传

用户不在 www-data 组或 sudo 组中,我读到这样做是一种安全风险,但即便如此,我还是暂时尝试将它们添加到 www-data 组以查看 wordpress 上传是否可以工作......它没有。我也尝试过 chown example1:www-data 所有权,但没有用。我也试过 chmod 777 上传文件夹,没有用。

错误日志有以下内容:在 wpms-error.log 中(这对我来说也没有意义)

2016/05/20 01:12:00 [crit] 1584#0: *1251 open() "/home/example1/example1.com-access.log" failed (13: Permission denied) while logging request, client: [my IP address], server: example1.com, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm-example1.sock", host: "example1.com", referrer: "https://example1.com/wp-admin/admin.php?import=wordpress&step=1&_wpnonce=dad4d82487"

在这些站点的 nginx conf 文件中,我有: access_log /home/example1/$host-access.log;

在 nginx.conf 中启用了访问日志(即使不推荐),但每个站点的访问日志并未写入其站点根目录。

所以...在尝试了我在网上阅读的所有内容之后...我什至还没有找出根本问题是什么...因为仅文件权限似乎不是吗?.. 是吗???

以下(将用户名更改为 example1 等后)是ps aux | grep php结果:

root       993  0.0  0.2 266688 11396 ?        Ss   May18   0:10 php-fpm: master process (/etc/php5/fpm/php-fpm.conf)
example1  1003  0.0  1.1 302568 45856 ?        S    May18   0:32 php-fpm: pool example1              
example1  1004  0.0  1.1 304620 47808 ?        S    May18   0:31 php-fpm: pool example1             
example2     1005  0.0  1.1 304360 47648 ?        S    May18   0:30 php-fpm: pool example2                   
example2     1007  0.0  1.1 302308 45956 ?        S    May18   0:30 php-fpm: pool example2                  
example3  1008  0.0  0.1 268640  7704 ?        S    May18   0:00 php-fpm: pool example3               
example3  1009  0.0  0.1 268640  7744 ?        S    May18   0:00 php-fpm: pool example3               
www-data  1010  0.0  0.1 266680  7560 ?        S    May18   0:00 php-fpm: pool www                     
www-data  1011  0.0  0.1 266680  7564 ?        S    May18   0:00 php-fpm: pool www                     
example4      1013  0.0  0.9 296016 39704 ?        S    May18   1:24 php-fpm: pool example4                   
example4      1014  0.0  1.3 310952 55024 ?        S    May18   1:23 php-fpm: pool example4                   
example5     1015  0.0  1.0 297352 40940 ?        S    May18   0:32 php-fpm: pool example5                  
example5     1016  0.0  1.1 305104 48232 ?        R    May18   0:32 php-fpm: pool example5                  
example4      1105  0.0  0.9 296016 39596 ?        S    May18   1:20 php-fpm: pool example4                    
example1  1313  0.0  0.9 296284 39884 ?        S    May18   0:31 php-fpm: pool example1              
example2     1317  0.0  1.1 304364 47628 ?        S    May18   0:29 php-fpm: pool example2                   
example5     1332  0.0  0.9 296880 39056 ?        S    May18   0:29 php-fpm: pool example5                   
example3  3727  0.0  0.0  11744   932 pts/1    S+   18:42   0:00 grep --color=auto php

上面的 example3 不是 wpms 站点,它只是一个空的 root atm,并且该用户也在 sudo 组中,并且拥有自己的 ssh 登录名。我不知道这是否相关。

nginx wordpress php-fpm wordpress-mu ubuntu-14.04
  • 1 个回答
  • 2748 Views
Martin Hope
warren
Asked: 2010-02-28 06:38:15 +0800 CST

从多个 WordPress 实例迁移到一个 WordPress MU?

  • 1

参考我之前的问题,其中处理多个 WordPress 实例的最佳方法似乎是使用 MU(甚至跨多个域等)-我正在寻找一种将多个单独的 WordPress 实例迁移到一个 wp-亩安装。

浏览WPMU Codex,我什么也没看到——不过也许我只是错过了它。

是否有人在 serverfault 上进行过这样的迁移,如果是这样,您能否说明如何处理它?

我在 CentOS 4 和 MySQL 5 上运行。

linux migration mysql wordpress wordpress-mu
  • 1 个回答
  • 213 Views
Martin Hope
mrpatg
Asked: 2010-02-27 01:29:58 +0800 CST

备份大型mysql数据库时遇到问题

  • 5

我有一个 wordpress MU 数据库,其中包含用于各种用户博客的 10,000 多个表。我需要将 wordpress MU 升级到最新版本,但想事先备份数据库。

当我单击导出时,PHPMyAdmin 甚至无法加载页面。我试过进入服务器(windows)并使用dos命令行:

mysqldump -u USERNAME -p PASSWORD> BACKUP.sql

但它挂了一分钟并给了我错误:

error 23: out of resources when opinging file '.\USERNAME\wp_1037_links.MYD' (Errorcode: 24) when using LOCK Tables

我做错了什么,或者我应该做什么?PHPMyAdmin 适合这种大小的东西吗?有没有比我尝试过的两种方法更好的方法?

**请注意,这不是我的网站,因此有关数据库设置的任何建议都必须由所有者运行。我只是来找 WP 相关的废话,这超出了我被要求做的事情的范围。

mysql command-line-interface wordpress wordpress-mu
  • 10 个回答
  • 4256 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve