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
    • 最新
    • 标签
主页 / user-124850

ReynierPM's questions

Martin Hope
ReynierPM
Asked: 2024-05-07 10:08:36 +0800 CST

将两个主机目录绑定挂载到同一个容器目录而不覆盖其内容,这可能吗?

  • 5

是否可以将两个主机目录绑定到同一个容器目录而不覆盖其内容?

我需要维护第一个绑定安装的源+新的源(来自第二个绑定安装的源)。我知道包含相同名称的文件和目录可以被覆盖,但是其余的呢?无论如何,Docker 总是会覆盖它们吗?

请参见以下示例:

# Dockerfile
FROM someimage

COPY app /app
COPY consumers/site1/theme /app/src/styles

# docker-compose.yml
services:
  base:
    platform: linux/amd64
    build:
      context: "."
      dockerfile: local/Dockerfile.consumer
    ports:
      - "3000:3000"
    volumes:
      - ./app/src:/app/src
      - ./consumers/site1/theme:/app/src/styles

我的第二个绑定安装中的文件docker-compose覆盖了...下的所有内容/app/src/styles有什么方法可以实现这一点吗?解决方法?

docker
  • 1 个回答
  • 29 Views
Martin Hope
ReynierPM
Asked: 2018-01-23 09:51:40 +0800 CST

“选项指令禁止的目录索引”可能是“请求超出 10 个内部重定向的限制”的原因吗?

  • 0

我正在尝试在我的本地环境中设置一个项目,以便我能够处理它。正在使用 PHP 5.3.3,Apache 2.2.15 和 CodeIgniter 2.3.1(PHP 和 CI 版本在这里不相关,但仅供参考,以防万一需要)。

我已经设置了一个 VH 如下:

<VirtualHost *:80>
    DocumentRoot "/var/www/html/document_api/public"
    ServerName document.api.localhost    
    <Directory "/var/www/html/document_api/public">
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>

    LogLevel debug
</VirtualHost>

项目/var/www/html/document_api/public/.htaccess文件如下:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /

#Rule 2: IF a file exists when .php is added, then rewrite URL by adding .php
RewriteRule ^([0-9A-_Za-z]+)$ $1.php [L]

RewriteCond %{REQUEST_FILENAME}.php !-f
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

当我尝试点击 URL 时,document.api.localhost:8080我得到了以下错误:

[Mon Jan 22 17:25:50 2018] [error] [client 10.0.2.2] Directory index forbidden by Options directive: /var/www/html/document_api/public/
[Mon Jan 22 17:25:50 2018] [error] [client 10.0.2.2] File does not exist: /var/www/error
[Mon Jan 22 17:25:51 2018] [error] [client 10.0.2.2] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3112): [client 10.0.2.2] r->uri = /index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/favicon.ico, referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/favicon.ico, referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/favicon.ico, referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /index.php/index.php/index.php/index.php/index.php/index.php/index.php/favicon.ico, referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /index.php/index.php/index.php/index.php/index.php/index.php/favicon.ico, referer: http://document.api.localhost:8080/ [Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /index.php/index.php/index.php/index.php/index.php/favicon.ico, referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /index.php/index.php/index.php/index.php/favicon.ico, referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /index.php/index.php/index.php/favicon.ico, referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /index.php/index.php/favicon.ico, referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /index.php/favicon.ico, referer: http://document.api.localhost:8080/
[Mon Jan 22 17:25:51 2018] [debug] core.c(3118): [client 10.0.2.2] redirected from r->uri = /favicon.ico, referer: http://document.api.localhost:8080/

我在这里错过了什么吗?这个设置有什么问题?

apache-2.2
  • 1 个回答
  • 1293 Views
Martin Hope
ReynierPM
Asked: 2016-12-25 08:38:08 +0800 CST

在默认的 Apache 2.4 设置中可以启用/禁用哪些模块?

  • -1

我正在使用 Apache 2.4 设置一个新的 CentOS 7 服务器,并且我计划通过 mod_proxy_fcgi 添加 PHP-FPM(根据这里的这篇文章)。我认为在这种情况下不需要默认启用的所有功能,但遗憾的是我不是 Apache 专家,所以我需要来自专家的一些建议。这是默认启用的:

LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_dbd_module modules/mod_authn_dbd.so
LoadModule authn_dbm_module modules/mod_authn_dbm.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_socache_module modules/mod_authn_socache.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_dbd_module modules/mod_authz_dbd.so
LoadModule authz_dbm_module modules/mod_authz_dbm.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_owner_module modules/mod_authz_owner.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cache_module modules/mod_cache.so
LoadModule cache_disk_module modules/mod_cache_disk.so
LoadModule data_module modules/mod_data.so
LoadModule dbd_module modules/mod_dbd.so
LoadModule deflate_module modules/mod_deflate.so
LoadModule dir_module modules/mod_dir.so
LoadModule dumpio_module modules/mod_dumpio.so
LoadModule echo_module modules/mod_echo.so
LoadModule env_module modules/mod_env.so
LoadModule expires_module modules/mod_expires.so
LoadModule ext_filter_module modules/mod_ext_filter.so
LoadModule filter_module modules/mod_filter.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule logio_module modules/mod_logio.so
LoadModule mime_magic_module modules/mod_mime_magic.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule remoteip_module modules/mod_remoteip.so
LoadModule reqtimeout_module modules/mod_reqtimeout.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule slotmem_plain_module modules/mod_slotmem_plain.so
LoadModule slotmem_shm_module modules/mod_slotmem_shm.so
LoadModule socache_dbm_module modules/mod_socache_dbm.so
LoadModule socache_memcache_module modules/mod_socache_memcache.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule status_module modules/mod_status.so
LoadModule substitute_module modules/mod_substitute.so
LoadModule suexec_module modules/mod_suexec.so
LoadModule unique_id_module modules/mod_unique_id.so
LoadModule unixd_module modules/mod_unixd.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule version_module modules/mod_version.so
LoadModule vhost_alias_module modules/mod_vhost_alias.so

我也看到了, dav, lua,mpm proxy所以systemd我假设这些也是默认加载的。cgi/etc/httpd/conf.modules.d

使用 PHP-FPM 启用/禁用什么并保持 Apache 运行?

httpd.conf httpd apache-2.4 centos7
  • 1 个回答
  • 6404 Views
Martin Hope
ReynierPM
Asked: 2016-12-16 12:00:43 +0800 CST

静态资源无法加载,这个 Nginx 设置有什么问题?

  • 0

在运行 PHP71-FPM 和 Nginx 的 Docker 容器中,我对 Nginx 进行了以下设置:

server {
    listen      80  default_server;
    listen      81  default_server http2 proxy_protocol; ## Needed when behind HAProxy with SSL termination + HTTP/2 support
    listen      443 default_server ssl http2;

    ssl_certificate       /etc/nginx/ssl/dummy.crt;
    ssl_certificate_key   /etc/nginx/ssl/dummy.key;

    root        /data/www/demos/jqgrid;
    index       index.php index.html index.htm;

    location ~ \.php$ {
      include         fastcgi_params;
      fastcgi_pass    php-upstream;
    }

    include     /etc/nginx/conf.d/stub-status.conf;
    include     /etc/nginx/conf.d/default-*.conf;
}

访问http://localhost会显示index页面,但没有加载样式或任何 JS 文件。我无法找到阻止访问静态文件的原因。

这是主机中命令的输出ls -la(请记住,这是一个运行 PHP-FPM 和 Nginx 的 Docker 容器):

$ ls -la ~/dev/
total 96
drwxrwxr-x  11     80     80 4096 Dec 15 14:36 .
drwx------. 40 rperez rperez 4096 Dec 15 15:01 ..
drwxr-xr-x   5     80     80 4096 Mar 13  2015 css
drwxr-xr-x   7     80     80 4096 Aug  5  2015 demos
drwxr-xr-x   6     80     80 4096 Mar 26  2015 js
drwxr-xr-x   2     80     80 4096 Mar 27  2015 northwindSQL
drwxr-xr-x   4     80     80 4096 Mar 16  2015 php

权限来自 Docker(对我来说很奇怪,但我在这里打开了另一篇文章)

这些文件来自我的存储库,而这些FROM文件来自Dockerfile中的存储库。

我能得到一些帮助吗?

更新

正如@Michael 建议的那样,我检查了容器上的 Nginx 日志,我可以看到以下内容:

php71-fpm-nginx | 2016-12-15 20:02:40,483 DEBG 'nginx' stderr output:
php71-fpm-nginx | 2016/12/15 20:02:40 [error] 33#33: *46 open() "/data/www/demos/jqgrid/css/jquery-ui.css" failed (2: No such file or directory), client: 172.20.0.1, server: , request: "GET /css/jquery-ui.css HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/index.php"
php71-fpm-nginx | 
php71-fpm-nginx | 2016-12-15 20:02:40,830 DEBG 'nginx' stderr output:
php71-fpm-nginx | 2016/12/15 20:02:40 [error] 33#33: *46 open() "/data/www/demos/jqgrid/css/control_icon.png" failed (2: No such file or directory), client: 172.20.0.1, server: , request: "GET /css/control_icon.png HTTP/1.1", host: "localhost:8080", referrer: "http://localhost:8080/index.php"
php71-fpm-nginx | 

但是,如果代码相反,这怎么可能呢?

<script src="../../js/jquery.min.js" type="text/javascript"></script>
<script src="../../js/jquery-ui.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="../../css/jquery-ui.css" media="screen" />
nginx static-content centos7
  • 1 个回答
  • 81 Views
Martin Hope
ReynierPM
Asked: 2016-12-15 13:28:45 +0800 CST

Nginx 下载“*.php”而不是在 Docker 环境中显示它的内容

  • 0

我正在运行PHP71 + Nginx的新 Docker 环境中工作。Dockerfile继承自million12/ docker -nginx。

这是/etc/nginx/hosts.d/vhost.conf(我从这里获取的)的内容:

server {
    listen      80  default_server;
    listen      81  default_server http2 proxy_protocol; ## Needed when behind HAProxy with SSL termination + HTTP/2 support
    listen      443 default_server ssl http2;

    ssl_certificate       /etc/nginx/ssl/dummy.crt;
    ssl_certificate_key   /etc/nginx/ssl/dummy.key;

    root        /data/www;
    index       index.php index.html index.htm;

    location ~ \.php$ {
        fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }

    include     /etc/nginx/conf.d/stub-status.conf;
    include     /etc/nginx/conf.d/default-*.conf;
    include     /data/conf/nginx/conf.d/default-*.conf;
}

我找不到为什么下载文件而不是显示它的内容。

在容器内,这就是我所拥有的/var/run:

# ls -la /var/run/
total 8
drwxr-xr-x 11 root root 185 Dec 14 21:12 .
drwxr-xr-x 19 root root 299 Dec 14 21:12 ..
drwxr-xr-x  2 root root   6 Sep  5 10:19 blkid
drwxr-xr-x  2 root root   6 Jul 29 14:05 console
drwxr-xr-x  2 root root   6 Jul 29 14:05 faillock
drwxr-xr-x  4 root root  35 Jul 29 14:05 lock
drwxr-xr-x  2 root root   6 Jul 29 14:05 log
-rw-r--r--  1 root root   2 Dec 14 21:12 php-fpm.pid
drwxr-xr-x  2 root root   6 Jul 29 14:05 sepermit
drwxr-xr-x  2 root root   6 Jul 29 14:05 setrans
-rw-r--r--  1 root root   3 Dec 14 21:12 supervisord.pid
drwxr-xr-x  9 root root 113 Jul 29 14:05 systemd
drwxr-xr-x  2 root root   6 Jul 29 14:05 user
-rw-rw-r--  1 root utmp   0 Jul 29 14:05 utmp

也许这一行:

 fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;

工作不正常。将其更改为:

fastcgi_pass    php-upstream;

在哪里php-upstream:

upstream php-upstream {
    server 127.0.0.1:9000;
}

也不行。我被困在这一点上。在打开另一个新帖子之前,我已经检查了所有这些帖子:

  • https://stackoverflow.com/questions/39950129/nginx-doesnt-serve-php-files(这是我前段时间打开的)
  • https://stackoverflow.com/questions/21103328/nginx-downloads-php-instead-of-running-it
  • https://stackoverflow.com/questions/27280977/nginx-php-page-downloads-instead-of-displaying
  • https://stackoverflow.com/questions/20668886/nginx-and-fastcgi-downloads-php-files-instead-of-processing-them
  • 在 Fedora 25/24、CentOS/RHEL 7.2/6.8 上安装 Nginx/PHP-FPM

任何人都可以给我一些帮助吗?请记住,所有这些都在 Docker 容器中运行,因此可能某些命令不可用。

nginx php-fpm docker
  • 3 个回答
  • 3671 Views
Martin Hope
ReynierPM
Asked: 2016-11-09 19:48:32 +0800 CST

.htaccess 在 WP 网站正常工作时阻止网站工作,为什么?

  • 2

我有三个站点在具有专用 IP 地址的共享主机 (Bluehost) 中运行。说明如下:

  • example.com=> 这是主站点和域,是一个 WP
  • example.net=> 这是一个附加域(不知道你是否熟悉这个术语)并且正在运行另一个 WP 站点
  • subsite.example.net=> 这是一个独立的 PHP 应用程序

每个 WP 都有自己的.htacess文件,如下所示:

# 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

有了这个.htaccess文件,两个 WP 站点都可以正常工作,但独立应用程序不能。如果我删除.htaccess文件,则相反,独立应用程序可以工作,但 WP 网站不能。

任何人都可以帮助我找到解决此问题的方法吗?

更新

我正在.htaccess为独立 PHP 应用程序的文件使用以下配置:

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

    # Add Caching.
    <FilesMatch ".(ico|jpg|jpeg|png|gif|js|css|swf)$">
        Header set Cache-Control "max-age=10800"
    </FilesMatch>

    # Prevent viewing of htaccess file.
    <Files .htaccess>
        order allow,deny
        deny from all
    </Files>

    # Prevent directory listings
    Options All -Indexes

    # Compress text, html, javascript, css, xml:
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>

但不工作,因为我一点击任何链接就被踢出应用程序。

独立站点位于/public_html/plataformaWP 位于/public_html. 为什么我在这一点上做错了?

.htaccess mod-rewrite apache2 rewritecond
  • 2 个回答
  • 301 Views
Martin Hope
ReynierPM
Asked: 2016-11-02 07:00:35 +0800 CST

一台带有多个虚拟主机的 Apache 开发服务器?

  • 1

假设我将有一个独特的开发服务器为多个开发人员共享代码。每个开发人员的代码都将位于其主目录下,sources因此基本上它将类似于~/<developer_name>/sources. 该服务器正在运行 Apache 2.4.x。

我需要每个开发人员都可以通过例如访问他们的代码<developer_name>.domain.com。当然,developer_nameURL 上的 将匹配/home目录上的名称。

我的解决方案是 Apache 配置上的每个开发人员的虚拟主机,有没有更好的解决方案,我不知道?

linux virtualhost apache-2.4 ubuntu-12.04
  • 2 个回答
  • 729 Views
Martin Hope
ReynierPM
Asked: 2015-11-14 17:30:07 +0800 CST

安装 httpd24、php56 和 php70,因为 SCL 无法使用错误“找不到文件”

  • 2

让我们开始说我已经在 Remi 博客上阅读了 this、this和this,因为它与这些存储库相关的问题。博客条目根本没有帮助我,或者我在这里遗漏了一些东西,但我不确定是什么。我将在下面公开我遵循了哪些步骤,让我们看看我做错了什么。我计划将 PHP 5.6.x 和 PHP 7.0 安装为 SCL(因为我需要在两者上测试一些应用程序,并且由于一些 Wordpress 开发,我需要保持 PHP 5.6.x 支持),我将通过 SetHandler 使用 Apache 2.4.x所以以下是步骤:

  1. 安装软件集合工具:

    yum install scl-utils
    
  2. 为您的系统下载包含存储库的软件包(在本例中为 httpd24)

    wget http://www.softwarecollections.org/en/scls/rhscl/httpd24/epel-6-x86_64/download/rhscl-httpd24-epel-6-x86_64.noarch.rpm
    
  3. 安装 repo 包:

    yum install rhscl-httpd24-epel-6-x86_64.noarch.rpm
    
  4. 安装集合:

    yum install httpd24
    
  5. 开始使用软件合集:

    scl enable httpd24 bash
    
  6. 启动 httpd24 服务(默认选项)

    service httpd24-httpd start
    
  7. 将 PHP56 安装为 SCL:

    yum install php56 php56-php-common php56-php-cli php56-php-fpm php56-php-gd php56-php-intl php56-php-mbstring php56-php-mcrypt php56-php-opcache php56-php-pdo php56-php-pear php56-php-pecl-apcu php56-php-imagick php56-php-pecl-xdebug php56-php-pgsql php56-php-xml php56-php-mysqlnd php56-php-pecl-jsonc php56-php-pecl-zip php56-php-process php56-runtime
    
  8. 启动 PHP56-FPM:

    service php56-php-fpm start
    
  9. 将 PHP70 安装为 SCL:

    yum install php70 php70-php-common php70-php-cli php70-php-fpm php70-php-gd php70-php-intl php70-php-mbstring php70-php-mcrypt php70-php-opcache php70-php-pdo php70-php-pear php70-php-pecl-apcu php70-php-imagick php70-php-pecl-xdebug php70-php-pgsql php70-php-xml php70-php-mysqlnd php70-php-pecl-jsonc php70-php-pecl-zip php70-php-process php70-runtime
    
  10. 测试 Apache 已安装并运行:

    http://mylocalip 
    

成功我可以看到 RedHat/CentOS 的 Apache 默认页面。到目前为止一切都很好。我在/var/www/html/info.php下面创建了一个文件,代码如下:

    <?php
     phpinfo();
    ?>

当我尝试通过运行达到:

http://mylocalip/info.php

它说找不到文件,所以 Apache 会去错误的地方,那很好,然后我在下面编辑文件/opt/rh/httpd24/root/etc/httpd/conf/httpd.conf并更改DocumentRoot为/opt/rh/httpd24/root/var/www/html,/var/www/html我在发现相同问题的所有地方都进行了相同的更改,我重新启动了 Apache 并再次尝试,但我得到了同样的错误。我已经检查了权限/var/www/html,这就是它们的样子:

# ls -l /var/www/
drwxrwsr-x 3 apache root 4096 Nov 13 04:51 html

我在这里想念什么?我做错了什么?任何人都可以给我一些想法或帮助吗?

php
  • 2 个回答
  • 16878 Views
Martin Hope
ReynierPM
Asked: 2015-11-03 13:24:19 +0800 CST

可用空间不足:需要 X 个扩展区,但只有 Y 个可用

  • 11

我正在尝试在 Vmware Workstation 12 Pro CentOS VM 中扩展 LVM。以下是我正在遵循的步骤以及我停止的地方,因为不知道如何从那里开始:

  1. fdisk使用命令创建主分区
  2. 使用以下方法获取分区表信息fdisk -l:

    # fdisk -l
    
    Disk /dev/sda: 85.9 GB, 85899345920 bytes
    255 heads, 63 sectors/track, 10443 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x0001d929
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1          64      512000   83  Linux
    Partition 1 does not end on cylinder boundary.
    /dev/sda2              64        5222    41430016   8e  Linux LVM
    /dev/sda3            5222       10443    41940357+  8e  Linux LVM
    
    Disk /dev/mapper/vg_webserver-lv_root: 38.3 GB, 38277218304 bytes
    255 heads, 63 sectors/track, 4653 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/mapper/vg_webserver-lv_swap: 4143 MB, 4143972352 bytes
    255 heads, 63 sectors/track, 503 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
  3. 将分区转换为物理卷:

    # pvcreate /dev/sda3
      Physical volume "/dev/sda3" successfully created  
    
  4. 获取要扩展的卷的名称:

    # vgdisplay
      --- Volume group ---
      VG Name               vg_webserver
      System ID
      Format                lvm2
      Metadata Areas        1
      Metadata Sequence No  3
      VG Access             read/write
      VG Status             resizable
      MAX LV                0
      Cur LV                2
      Open LV               2
      Max PV                0
      Cur PV                1
      Act PV                1
      VG Size               39.51 GiB
      PE Size               4.00 MiB
      Total PE              10114
      Alloc PE / Size       10114 / 39.51 GiB
      Free  PE / Size       0 / 0
      VG UUID               qo4qm0-yTZc-TVzt-Ys0t-Ap2j-sH4X-rtMqPS
    
  5. 扩展物理卷:

    # vgextend vg_webserver /dev/sda3
      Volume group "vg_webserver" successfully extended
    
  6. 获得可用的“免费”空间:

    # vgextend vg_webserver /dev/sda3
      Volume group "vg_webserver" successfully extended
    
  7. 获取逻辑卷的信息:

    # lvdisplay
      --- Logical volume ---
      LV Path                /dev/vg_webserver/lv_root
      LV Name                lv_root
      VG Name                vg_webserver
      LV UUID                ayl9Ae-Y7nk-CVXG-c0G1-P4vx-wdlD-hEmXSO
      LV Write Access        read/write
      LV Creation host, time webserver.localhost, 2015-10-27 12:48:48 -0400
      LV Status              available
      # open                 1
      LV Size                35.65 GiB
      Current LE             9126
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:0
    
      --- Logical volume ---
      LV Path                /dev/vg_webserver/lv_swap
      LV Name                lv_swap
      VG Name                vg_webserver
      LV UUID                vwXfta-tGr0-kQFI-B2vF-L4gT-skE5-yb5qXA
      LV Write Access        read/write
      LV Creation host, time webserver.localhost, 2015-10-27 12:48:52 -0400
      LV Status              available
      # open                 1
      LV Size                3.86 GiB
      Current LE             988
      Segments               1
      Allocation             inherit
      Read ahead sectors     auto
      - currently set to     256
      Block device           253:1
    
  8. 扩展逻辑卷:

    # lvextend -L+40G /dev/vg_webserver/lv_root
      Insufficient free space: 10240 extents needed, but only 10239 available
    

我得到了上面的错误,我不知道从那里去哪里以及如何解决这个问题,有什么可以帮助我的吗?我做错了什么,我正在运行的问题背后的逻辑解释是什么?

注意:我已阅读此内容,但我不确定如何撤消我已经做出的所有更改,以及此信息是否是要遵循的路径

更新

这里要求的是以下命令的输出:

# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               vg_webserver
  PV Size               39.51 GiB / not usable 3.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              10114
  Free PE               0
  Allocated PE          10114
  PV UUID               mwFIHY-mwwJ-b3uk-PkbP-7JXp-Vp2t-foCZtt

  --- Physical volume ---
  PV Name               /dev/sda3
  VG Name               vg_webserver
  PV Size               40.00 GiB / not usable 1.38 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              10239
  Free PE               0
  Allocated PE          10239
  PV UUID               tWg4Oj-ZknB-mefb-Ggy9-V8Cu-C7S2-OvO5aU

# vgdisplay
  --- Volume group ---
  VG Name               vg_webserver
  System ID
  Format                lvm2
  Metadata Areas        2
  Metadata Sequence No  5
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               2
  Max PV                0
  Cur PV                2
  Act PV                2
  VG Size               79.50 GiB
  PE Size               4.00 MiB
  Total PE              20353
  Alloc PE / Size       20353 / 79.50 GiB
  Free  PE / Size       0 / 0
  VG UUID               qo4qm0-yTZc-TVzt-Ys0t-Ap2j-sH4X-rtMqPS

# lvdisplay
  --- Logical volume ---
  LV Path                /dev/vg_webserver/lv_root
  LV Name                lv_root
  VG Name                vg_webserver
  LV UUID                ayl9Ae-Y7nk-CVXG-c0G1-P4vx-wdlD-hEmXSO
  LV Write Access        read/write
  LV Creation host, time webserver.localhost, 2015-10-27 12:48:48 -0400
  LV Status              available
  # open                 1
  LV Size                75.64 GiB
  Current LE             19365
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:0

  --- Logical volume ---
  LV Path                /dev/vg_webserver/lv_swap
  LV Name                lv_swap
  VG Name                vg_webserver
  LV UUID                vwXfta-tGr0-kQFI-B2vF-L4gT-skE5-yb5qXA
  LV Write Access        read/write
  LV Creation host, time webserver.localhost, 2015-10-27 12:48:52 -0400
  LV Status              available
  # open                 1
  LV Size                3.86 GiB
  Current LE             988
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           253:1
virtual-machines
  • 4 个回答
  • 54682 Views
Martin Hope
ReynierPM
Asked: 2015-07-01 09:09:14 +0800 CST

通过 SSH 连接到 MariaDB 失败并出现错误 2013 - 在“读取初始通信数据包”时丢失与 MySQL 服务器的连接

  • 1

我正在尝试使用 Windows 中的 Navicat Premium 通过 SSH 连接到远程 MariaDB 服务器,但我一直无法并收到此错误:

2013 - 在“读取初始通信数据包”时失去与 MySQL 服务器的连接,系统错误:0

我已经阅读并遵循互联网上的许多指南,所以我现在迷路了,不知道还能做什么。这就是我所做的:

在服务器端(使用 CentOS 6.6 和 mysql Ver 15.1 Distrib 5.5.44-MariaDB 的远程主机,用于 Linux (x86_64) 使用 readline 5.1):

  • /etc/my.cnf.d/server.cnf设置这个参数:

    [mysqld]
    #skip-networking
    
    #tried with this
    bind-address = 0.0.0.0
    
    #tried with this
    bind-address = 127.0.0.1
    
    #tried with this
    bind-address = localhost
    

    结果:没有成功,同样的错误,无法连接

  • /etc/hosts.allow设置此参数:

    # tried with this
    #ALL:ALL
    # tried with this
    ALL:PARANOID
    # tried with this
    ALL:MY_IP_ADDR
    

    结果:没有成功,同样的错误,无法连接

  • /etc/ssh/sshd_config允许 TCP 转发的设置参数:

    AllowTcpForwarding 是

    结果:没有成功,同样的错误,无法连接

服务器启用了 IPTABLES,但端口 3306 已打开:

#MySQL/MariaDB
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT

这是配置在 Navicat 上的样子:

在此处输入图像描述 在此处输入图像描述

任何人都可以帮我解决这个问题吗?我花了几个小时没有成功

centos
  • 1 个回答
  • 3583 Views
Martin Hope
ReynierPM
Asked: 2015-03-28 08:27:40 +0800 CST

确定后台进程的启动位置和方式以及它们来自何处

  • 0

首先是简短的故事:我需要迁移服务器(应用程序、配置等),但我不知道里面有什么,没有文档,负责人只是放弃并且没有留下任何信息,所以这是一种黑匣子或黑洞。我的任务是将服务器中的内容移至新实例并了解其中的工作方式。问题是有一些后台进程正在运行(参见下面的 ps -ax 输出):

ps -ax

Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
  PID TTY      STAT   TIME COMMAND
  ...
  841 ?        Ss    13:42 python /usr/local/bin/pdoInstaller/
  848 ?        Ss     0:04 php /usr/local/bin/pdoneVendorBroker/vendorBroker.php
  950 ?        Ssl   13:00 /usr/bin/mongod --config /etc/mongodb.conf
  013 ?        S      0:00 CRON
 1014 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 1015 ?        Ssl    1:02 /usr/sbin/mysqld
 1016 ?        S      0:02 /usr/bin/php rss_article_loader.php
 1065 ?        Ssl    0:29 /usr/sbin/nova-agent -q -p /var/run/nova-agent.pid -o /var/log/nova-agent.log -l info /usr/share/nova-agent/nova-agent.py
 1219 ?        S      0:01 /usr/lib/erlang/erts-5.10.3/bin/epmd -daemon
 1222 ?        S      0:00 CRON
 1223 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 1224 ?        S      0:01 /usr/bin/php rss_article_loader.php
 1506 ?        S      0:00 /bin/sh /usr/sbin/rabbitmq-server
 1517 ?        Sl    15:59 /usr/lib/erlang/erts-5.10.3/bin/beam.smp -W w -K true -A30 -P 1048576 -- -root /usr/lib/erlang -progname erl -- -home /var/lib/rabbitmq -- -noshell -noinput -sname rabbit@pdone-db-qa -boot /v
 1728 ?        S      0:00 CRON
 1729 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 1730 ?        S      0:00 /usr/bin/php rss_article_loader.php
 3137 ?        Ss     0:04 php /usr/local/bin/shareEventHandler/shareEventHandler.php
 3165 ?        Ss     0:04 php /usr/local/bin/repToolBroker/repToolBroker.php
 3180 ?        Ss     0:04 php /usr/local/bin/pdoneLoginProctor/loginProctor.php
 3201 ?        Ss     0:04 php /usr/local/bin/messageBroker/messageBroker.php
 3230 ?        Ss     0:04 php /usr/local/bin/emailBroker/emailBroker.php
 3250 ?        Ss     0:04 php /usr/local/bin/edetailBroker/edetailBroker.php
 3270 ?        Ss     0:04 php /usr/local/bin/cmeBroker/cmeBroker.php
 3921 ?        S      0:00 CRON
 3922 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 3923 ?        S      0:03 /usr/bin/php rss_article_loader.php
 4395 ?        S      0:00 CRON
 4396 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 4397 ?        S      0:02 /usr/bin/php rss_article_loader.php
 4498 ?        S      0:00 CRON
 4499 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 4500 ?        S      0:01 /usr/bin/php rss_article_loader.php
 5781 ?        S      0:00 CRON
 5782 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 5783 ?        S      0:04 /usr/bin/php rss_article_loader.php
 7242 ?        S      0:00 CRON
 7243 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 7244 ?        S      0:03 /usr/bin/php rss_article_loader.php
 7575 ?        S      0:00 CRON
 7576 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 7577 ?        S      0:02 /usr/bin/php rss_article_loader.php
 7705 ?        S      0:00 CRON
 7706 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 7707 ?        S      0:01 /usr/bin/php rss_article_loader.php
 9368 ?        S      0:00 CRON
 9369 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
 9370 ?        S      0:04 /usr/bin/php rss_article_loader.php
10450 ?        S      0:00 CRON
10451 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
10452 ?        S      0:03 /usr/bin/php rss_article_loader.php
10771 ?        S      0:00 CRON
10772 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
10773 ?        S      0:02 /usr/bin/php rss_article_loader.php
10884 ?        S      0:00 CRON
10885 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
10886 ?        S      0:01 /usr/bin/php rss_article_loader.php
12947 ?        S      0:00 CRON
12949 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
12951 ?        S      0:04 /usr/bin/php rss_article_loader.php
13573 ?        S      0:00 CRON
13574 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
13575 ?        S      0:03 /usr/bin/php rss_article_loader.php
13963 ?        S      0:00 CRON
13964 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
13965 ?        S      0:01 /usr/bin/php rss_article_loader.php
14157 ?        S      0:00 CRON
14158 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
14159 ?        S      0:00 /usr/bin/php rss_article_loader.php
16083 ?        S      0:00 CRON
16084 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
16085 ?        S      0:04 /usr/bin/php rss_article_loader.php
17089 ?        S      0:00 CRON
17090 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
17091 ?        S      0:03 /usr/bin/php rss_article_loader.php
17103 ?        S      0:00 CRON
17104 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
17105 ?        S      0:01 /usr/bin/php rss_article_loader.php
17553 ?        S      0:00 CRON
17554 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
17555 ?        S      0:00 /usr/bin/php rss_article_loader.php
19227 ?        S      0:00 CRON
19228 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
19229 ?        S      0:04 /usr/bin/php rss_article_loader.php
20318 ?        S      0:00 CRON
20319 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
20320 ?        S      0:01 /usr/bin/php rss_article_loader.php
20375 ?        S      0:00 CRON
20376 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
20377 ?        S      0:02 /usr/bin/php rss_article_loader.php
20722 ?        S      0:00 CRON
20723 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
20724 ?        S      0:00 /usr/bin/php rss_article_loader.php
22324 ?        S      0:00 CRON
22325 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
22326 ?        S      0:03 /usr/bin/php rss_article_loader.php
23549 ?        S      0:00 CRON
23550 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
23551 ?        S      0:01 /usr/bin/php rss_article_loader.php
23643 ?        S      0:00 CRON
23644 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
23645 ?        S      0:02 /usr/bin/php rss_article_loader.php
23945 ?        S      0:00 CRON
23946 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
23947 ?        S      0:00 /usr/bin/php rss_article_loader.php
25875 ?        S      0:00 CRON
25876 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
25877 ?        S      0:03 /usr/bin/php rss_article_loader.php
26840 ?        S      0:00 CRON
26841 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
26842 ?        S      0:02 /usr/bin/php rss_article_loader.php
27223 ?        S      0:00 CRON
27225 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
27227 ?        S      0:01 /usr/bin/php rss_article_loader.php
27538 ?        S      0:00 CRON
27539 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
27540 ?        S      0:00 /usr/bin/php rss_article_loader.php
29374 ?        S      0:00 CRON
29375 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
29376 ?        S      0:03 /usr/bin/php rss_article_loader.php
30232 ?        S      0:00 CRON
30233 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
30234 ?        S      0:02 /usr/bin/php rss_article_loader.php
30444 ?        S      0:00 CRON
30445 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
30446 ?        S      0:01 /usr/bin/php rss_article_loader.php
30682 ?        S      0:00 /usr/sbin/apache2 -k start
30683 ?        S      0:00 /usr/sbin/apache2 -k start
30848 ?        S      0:00 CRON
30849 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
30850 ?        S      0:00 /usr/bin/php rss_article_loader.php
32692 ?        S      0:00 CRON
32693 ?        Ss     0:00 /bin/sh -c cd /var/www/pdone/ipad_v2/rpc; /usr/bin/php rss_article_loader.php
32694 ?        S      0:03 /usr/bin/php rss_article_loader.php

有些是通过 CRON 运行的,我已经确定了那些简单的路径,但其他一些像由 PHP 开始的那些,例如:

 3137 ?        Ss     0:04 php /usr/local/bin/shareEventHandler/shareEventHandler.php
 3165 ?        Ss     0:04 php /usr/local/bin/repToolBroker/repToolBroker.php
 3180 ?        Ss     0:04 php /usr/local/bin/pdoneLoginProctor/loginProctor.php

我不知道它是从哪里来的,我需要知道它们是从哪里开始以及如何开始的,以便在新服务器上设置相同的东西,有没有人可以提供一些关于如何解决这个问题的想法?目前我唯一知道的是 RabbitMQ 使用该脚本来传递消息并执行一些任务。我需要确定后台进程的启动位置和方式以及它们的来源。原始服务器是 Ubuntu 新的服务器是 CentOS 不是问题,但仅供参考,任何人都可以给我一些帮助或想法吗?

更新

我cmeBroker.conf在目录中找到了一个文件,/usr/local/bin/cmeBroker以此类推,这是该文件的内容:

description "PDone cmeBroker"

start on runlevel [234]
stop on runlevel [0156]

respawn
exec php /usr/local/bin/cmeBroker/cmeBroker.php
post-start script
    PID=`status cmeBroker | egrep -oi '([0-9]+)$' | head -n1`
    echo $PID > /var/run/cmeBroker.pid
end script

post-stop script
    rm -f /var/run/cmeBroker.pid
end script

所以现在这是一个线索,但谁负责启动或读取这个文件?

更新 2

正如@ivan所建议的,我已安装auditd在 Ubuntu 服务器上,并运行了以下命令:

auditctl -w /usr/local/bin/repToolBroker/repToolBroker.php -p rwxa

我应该重新启动服务器还是只是等待并找到使用:

ausearch -f /usr/local/bin/repToolBroker/repToolBroker.php

谁访问或更改了文件?这可以告诉我谁负责启动这些文件并在后台执行它们?

更新 3

使用@julian-sivertsen建议在文件系统中搜索与文件名匹配的文本字符串,多亏了我从这里得到的另一个帮助,我运行了这个命令:

sudo grep -r 'shareEventHandler.php\|repToolBroker.php\|loginProctor.php\|messageBroker.php\|emailBroker.php\|edetailBroker.php\|cmeBroker.php' .

这使我可以找到调用文件的位置。这是上面命令的输出:

./init/emailBroker.conf:exec php /usr/local/bin/emailBroker/emailBroker.php
./init/cmeBroker.conf:exec php /usr/local/bin/cmeBroker/cmeBroker.php
./init/pdoneLoginProctor.conf:exec php /usr/local/bin/pdoneLoginProctor/loginProctor.php
./init/edetailBroker.conf:exec php /usr/local/bin/edetailBroker/edetailBroker.php
./init/messageBroker.conf:exec php /usr/local/bin/messageBroker/messageBroker.php
grep: ./init/veevaBroker.conf: No such file or directory
./init/shareEventHandler.conf:exec php /usr/local/bin/shareEventHandler/shareEventHandler.php
./init/repToolBroker.conf:exec php /usr/local/bin/repToolBroker/repToolBroker.php

该.conf文件是我之前找到的文件的符号链接,这就是所有发生的地方。现在我还有一个问题,init文件夹是做什么用的?这是我第一次处理这个问题,我很想知道和学习。

任何?

linux
  • 2 个回答
  • 159 Views
Martin Hope
ReynierPM
Asked: 2015-02-08 12:32:16 +0800 CST

在 bash 中执行脚本期间命令失败

  • 0

我正在编写一个用于自动化一些常见任务的 bash 脚本,但我遇到了一些问题,我需要一些帮助。这是我正在谈论的脚本:

#!/usr/bin/env bash

PS3='Please enter your choice: '
options=("Prepare environment" "Create new group" "Add users to group" "Change directory ownership" "Change directory permissions" "Quit")
select opt in "${options[@]}"
do
    case $opt in
        "Prepare environment")
            read -e -p "Enter the work directory: " -i "/var/www/html/" directory
            cd directory

            echo "Updating BOWER..."
            npm -g update bower

            echo "Updating COMPOSER..."
            composer self-update

            read -e -p "Enter the environment: " -i "prod" environment

            if [environment eq prod]
            then
                git fetch --all
                git reset --hard origin/master
                git pull

                composer install --no-dev --optimize-autoloader
                php app/console cache:clear --env=prod --no-debug
            else
                read -e -p "Enter the environment type: " -i "local" envtype

                if [envtype eq local]
                then
                    composer update
                    php app/console cache:clear --env=dev
                    php app/console cache:warmup
                else 
                    git fetch --all
                    git reset --hard origin/master
                    git pull

                    composer update
                    php app/console cache:clear --env=dev
                    php app/console cache:warmup
                fi  
            fi          

            echo "Cleaning the house and updating libraries..." 
            bower cache clean --allow-root
            bower prune --allow-root
            bower install --allow-root
            bower update --allow-root
        ;;
        "Create new group")
            read -e -p "Enter the group name: " -i "www-pub" groupname
            groupadd groupname
            echo "You have added a new group: " groupname
            ;;
        "Add users to group")
            read -e -p "Enter the group name: " -i "www-pub" groupname
            loop=true          # "true" is a command

            while true; do
                read -p "enter username: " username
                [[ -z $username ]] && break

                usermod -a -G groupname username # add user to group
                echo "You have added: " username " to group: " groupname
            done        
            ;;
        "Change directory ownership")
            read -e -p "Enter the group name: " -i "www-pub" "Enter the directory: " -i "/var/www/html" groupname directory
            chown -R root:groupname directory
            echo "You have changed the ownership for: " directory " to root:" groupname
            ;;
        "Change directory permissions")
            read -e -p "Enter the directory: " -i "/var/www/html" "Enter the directtory permissions (type -d) : " -i "2775" "Enter the directtory files (type -f) : " -i "0664"  directory folder files
            echo "Setting permissions " folder " to " directory
            find directory -type d -print0 | xargs -0 chmod permissions 
            echo "Setting permissions " files " to " directory " files"
            find directory -type f -print0 | xargs -0 chmod files 
            ;;
        "Quit")
            break
            ;;
        *) echo invalid option;;
    esac
done

每当我运行脚本时,我都会得到以下输出:

root@test-webserver:/var/www/sis-php-source# /home/script.sh
1) Prepare environment           4) Change directory ownership
2) Create new group              5) Change directory permissions
3) Add users to group            6) Quit
Please enter your choice: 1
Enter the work directory: /var/www/sis-php-source/
/home/script.sh: line 10: cd: directory: No such file or directory
Updating BOWER...
Updating COMPOSER...
You are already using composer version 07c644ac229a21df80180598d8bb9aaba232eecb.
Enter the environment: prod
/home/script.sh: line 20: [environment: command not found
Enter the environment type: local

为什么cd命令失败?如果脚本是输入变量,为什么environment脚本会尝试environment作为命令执行?任何人都可以给我一些帮助吗?

linux
  • 1 个回答
  • 543 Views
Martin Hope
ReynierPM
Asked: 2014-12-03 03:42:24 +0800 CST

Composer 以 root 身份工作,但不能以普通用户身份工作,为什么?

  • 0

正如本文档所示,我已经在全球范围内安装了 Composer ,它适用root于我的服务器 CentOS 6.6 上的用户,但作为普通用户,webvm它不会说找不到 composer(见下文):

[webvm@webvm ~]$ sudo composer
[sudo] password for webvm:
sudo: composer: command not found

我是否需要设置其他东西才能让作曲家从非 root 用户那里工作?webvm在 sudoers 文件中,所以我不知道我在这里缺少什么,有什么建议吗?

centos
  • 1 个回答
  • 4386 Views
Martin Hope
ReynierPM
Asked: 2014-06-20 18:56:00 +0800 CST

从本地开发服务器发送电子邮件

  • 1

我正在进行网站开发,需要测试一些电子邮件内容(仅向我发送电子邮件以注册用户,我为此目的使用我的个人电子邮件地址)。我不是专家,所以我只安装了 Postfix,它没有配置,我不知道该怎么做,或者即使有可能。作为操作系统,我使用的是 CentOS 6.5,并且我在具有两个网卡的 Vmware 虚拟机中运行它:一个具有 NAT 连接,与主机共享 Internet,另一个是具有本地地址的内部卡,用于通过 Putty 等进行连接.

我真的不需要发送电子邮件,但如果可以的话会很好,只需查看他们的内容以观察行为。我从 PHP 站点发送了一些电子邮件,然后检查/var/log/maillog使用tail,这是输出:

Jun 17 16:47:21 localhost postfix/pickup[16879]: 5E2BFA4B38: uid=48 from=<[email protected]>
Jun 17 16:47:21 localhost postfix/cleanup[16891]: 5E2BFA4B38: message-id=<[email protected]>
Jun 17 16:47:21 localhost postfix/qmgr[16880]: 5E2BFA4B38: from=<[email protected]>, size=1773, nrcpt=1 (queue active)
Jun 17 16:47:21 localhost postfix/smtp[16893]: 5E2BFA4B38: to=<[email protected]>, relay=192.168.1.101[192.168.1.101]:25, delay=0.05, delays=0.03/0.01/0/0.01, dsn=5.0.0, status=bounced (host 192.168.1.101[192.168.1.101] said: 530 SMTP authentication is required. (in reply to RCPT TO command))
Jun 17 16:47:21 localhost postfix/cleanup[16891]: 67EE6A4B37: message-id=<[email protected]>
Jun 17 16:47:21 localhost postfix/qmgr[16880]: 67EE6A4B37: from=<>, size=3752, nrcpt=1 (queue active)
Jun 17 16:47:21 localhost postfix/bounce[16894]: 5E2BFA4B38: sender non-delivery notification: 67EE6A4B37
Jun 17 16:47:21 localhost postfix/qmgr[16880]: 5E2BFA4B38: removed
Jun 17 16:47:21 localhost postfix/smtp[16893]: 67EE6A4B37: to=<[email protected]>, relay=192.168.1.101[192.168.1.101]:25, delay=0.01, delays=0/0/0/0.01, dsn=5.0.0, status=bounced (host 192.168.1.101[192.168.1.101] said: 530 SMTP authentication is required. (in reply to RCPT TO command))
Jun 17 16:47:21 localhost postfix/qmgr[16880]: 67EE6A4B37: removed

但是,如果我运行命令,postqueue -p我会得到Mail queue is empty电子邮件的去向?我需要查看他们的内容,postcat -vq XXXXXXXXXX但由于没有电子邮件,我无法获取 ID,为什么?有什么建议或帮助吗?

postconf 命令输出

2bounce_notice_recipient = postmaster
access_map_defer_code = 450
access_map_reject_code = 554
address_verify_default_transport = $default_transport
address_verify_local_transport = $local_transport
address_verify_map =
address_verify_negative_cache = yes
address_verify_negative_expire_time = 3d
address_verify_negative_refresh_time = 3h
address_verify_poll_count = ${stress?1}${stress:3}
address_verify_poll_delay = 3s
address_verify_positive_expire_time = 31d
address_verify_positive_refresh_time = 7d
address_verify_relay_transport = $relay_transport
address_verify_relayhost = $relayhost
address_verify_sender = $double_bounce_sender
address_verify_sender_dependent_relayhost_maps = $sender_dependent_relayhost_maps
address_verify_service_name = verify
address_verify_transport_maps = $transport_maps
address_verify_virtual_transport = $virtual_transport
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
allow_mail_to_commands = alias, forward
allow_mail_to_files = alias, forward
allow_min_user = no
allow_percent_hack = yes
allow_untrusted_routing = no
alternate_config_directories =
always_add_missing_headers = no
always_bcc =
anvil_rate_time_unit = 60s
anvil_status_update_time = 600s
append_at_myorigin = yes
append_dot_mydomain = yes
application_event_drain_time = 100s
authorized_flush_users = static:anyone
authorized_mailq_users = static:anyone
authorized_submit_users = static:anyone
backwards_bounce_logfile_compatibility = yes
berkeley_db_create_buffer_size = 16777216
berkeley_db_read_buffer_size = 131072
best_mx_transport =
biff = yes
body_checks =
body_checks_size_limit = 51200
bounce_notice_recipient = postmaster
bounce_queue_lifetime = 5d
bounce_service_name = bounce
bounce_size_limit = 50000
bounce_template_file =
broken_sasl_auth_clients = no
canonical_classes = envelope_sender, envelope_recipient, header_sender, header_recipient
canonical_maps =
cleanup_service_name = cleanup
command_directory = /usr/sbin
command_execution_directory =
command_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
command_time_limit = 1000s
config_directory = /etc/postfix
connection_cache_protocol_timeout = 5s
connection_cache_service_name = scache
connection_cache_status_update_time = 600s
connection_cache_ttl_limit = 2s
content_filter =
cyrus_sasl_config_path =
daemon_directory = /usr/libexec/postfix
default_database_type = hash
default_delivery_slot_cost = 5
default_delivery_slot_discount = 50
default_delivery_slot_loan = 3
default_destination_concurrency_failed_cohort_limit = 1
default_destination_concurrency_limit = 20
default_destination_concurrency_negative_feedback = 1
default_destination_concurrency_positive_feedback = 1
default_destination_rate_delay = 0s
default_destination_recipient_limit = 50
default_extra_recipient_limit = 1000
default_minimum_delivery_slots = 3
default_privs = nobody
default_process_limit = 100
default_rbl_reply = $rbl_code Service unavailable; $rbl_class [$rbl_what] blocked using $rbl_domain${rbl_reason?; $rbl_reason}
default_recipient_limit = 20000
default_recipient_refill_delay = 5s
default_recipient_refill_limit = 100
default_transport = smtp
default_verp_delimiters = +=
defer_code = 450
defer_service_name = defer
defer_transports =
delay_logging_resolution_limit = 2
delay_notice_recipient = postmaster
delay_warning_time = 0h
deliver_lock_attempts = 20
deliver_lock_delay = 1s
destination_concurrency_feedback_debug = no
detect_8bit_encoding_header = yes
disable_dns_lookups = no
disable_mime_input_processing = no
disable_mime_output_conversion = no
disable_verp_bounces = no
disable_vrfy_command = no
dont_remove = 0
double_bounce_sender = double-bounce
duplicate_filter_limit = 1000
empty_address_recipient = MAILER-DAEMON
empty_address_relayhost_maps_lookup_key = <>
enable_original_recipient = yes
error_notice_recipient = postmaster
error_service_name = error
execution_directory_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
expand_owner_alias = no
export_environment = TZ MAIL_CONFIG LANG
fallback_transport =
fallback_transport_maps =
fast_flush_domains = $relay_domains
fast_flush_purge_time = 7d
fast_flush_refresh_time = 12h
fault_injection_code = 0
flush_service_name = flush
fork_attempts = 5
fork_delay = 1s
forward_expansion_filter = 1234567890!@%-_=+:,./abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ
forward_path = $home/.forward${recipient_delimiter}${extension}, $home/.forward
frozen_delivered_to = yes
hash_queue_depth = 1
hash_queue_names = deferred, defer
header_address_token_limit = 10240
header_checks =
header_size_limit = 102400
helpful_warnings = yes
home_mailbox =
hopcount_limit = 50
html_directory = no
ignore_mx_lookup_error = no
import_environment = MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG TZ XAUTHORITY DISPLAY LANG=C
in_flow_delay = 1s
inet_interfaces = localhost
inet_protocols = all
initial_destination_concurrency = 5
internal_mail_filter_classes =
invalid_hostname_reject_code = 501
ipc_idle = 5s
ipc_timeout = 3600s
ipc_ttl = 1000s
line_length_limit = 2048
lmtp_assume_final = no
lmtp_bind_address =
lmtp_bind_address6 =
lmtp_body_checks =
lmtp_cname_overrides_servername = no
lmtp_connect_timeout = 0s
lmtp_connection_cache_destinations =
lmtp_connection_cache_on_demand = yes
lmtp_connection_cache_time_limit = 2s
lmtp_connection_reuse_time_limit = 300s
lmtp_data_done_timeout = 600s
lmtp_data_init_timeout = 120s
lmtp_data_xfer_timeout = 180s
lmtp_defer_if_no_mx_address_found = no
lmtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
lmtp_destination_concurrency_limit = $default_destination_concurrency_limit
lmtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
lmtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
lmtp_destination_rate_delay = $default_destination_rate_delay
lmtp_destination_recipient_limit = $default_destination_recipient_limit
lmtp_discard_lhlo_keyword_address_maps =
lmtp_discard_lhlo_keywords =
lmtp_enforce_tls = no
lmtp_generic_maps =
lmtp_header_checks =
lmtp_host_lookup = dns
lmtp_initial_destination_concurrency = $initial_destination_concurrency
lmtp_lhlo_name = $myhostname
lmtp_lhlo_timeout = 300s
lmtp_line_length_limit = 990
lmtp_mail_timeout = 300s
lmtp_mime_header_checks =
lmtp_mx_address_limit = 5
lmtp_mx_session_limit = 2
lmtp_nested_header_checks =
lmtp_pix_workaround_delay_time = 10s
lmtp_pix_workaround_maps =
lmtp_pix_workaround_threshold_time = 500s
lmtp_pix_workarounds = disable_esmtp,delay_dotcrlf
lmtp_quit_timeout = 300s
lmtp_quote_rfc821_envelope = yes
lmtp_randomize_addresses = yes
lmtp_rcpt_timeout = 300s
lmtp_rset_timeout = 20s
lmtp_sasl_auth_cache_name =
lmtp_sasl_auth_cache_time = 90d
lmtp_sasl_auth_enable = no
lmtp_sasl_auth_soft_bounce = yes
lmtp_sasl_mechanism_filter =
lmtp_sasl_password_maps =
lmtp_sasl_path =
lmtp_sasl_security_options = noplaintext, noanonymous
lmtp_sasl_tls_security_options = $lmtp_sasl_security_options
lmtp_sasl_type = cyrus
lmtp_send_xforward_command = no
lmtp_sender_dependent_authentication = no
lmtp_skip_5xx_greeting = yes
lmtp_skip_quit_response = no
lmtp_starttls_timeout = 300s
lmtp_tcp_port = 24
lmtp_tls_CAfile =
lmtp_tls_CApath =
lmtp_tls_cert_file =
lmtp_tls_ciphers = export
lmtp_tls_dcert_file =
lmtp_tls_dkey_file = $lmtp_tls_dcert_file
lmtp_tls_eccert_file =
lmtp_tls_eckey_file = $lmtp_tls_eccert_file
lmtp_tls_enforce_peername = yes
lmtp_tls_exclude_ciphers =
lmtp_tls_fingerprint_cert_match =
lmtp_tls_fingerprint_digest = md5
lmtp_tls_key_file = $lmtp_tls_cert_file
lmtp_tls_loglevel = 0
lmtp_tls_mandatory_ciphers = medium
lmtp_tls_mandatory_exclude_ciphers =
lmtp_tls_mandatory_protocols = SSLv3, TLSv1
lmtp_tls_note_starttls_offer = no
lmtp_tls_per_site =
lmtp_tls_policy_maps =
lmtp_tls_protocols = !SSLv2
lmtp_tls_scert_verifydepth = 9
lmtp_tls_secure_cert_match = nexthop
lmtp_tls_security_level =
lmtp_tls_session_cache_database =
lmtp_tls_session_cache_timeout = 3600s
lmtp_tls_verify_cert_match = hostname
lmtp_use_tls = no
lmtp_xforward_timeout = 300s
local_command_shell =
local_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
local_destination_concurrency_limit = 2
local_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
local_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
local_destination_rate_delay = $default_destination_rate_delay
local_destination_recipient_limit = 1
local_header_rewrite_clients = permit_inet_interfaces
local_initial_destination_concurrency = $initial_destination_concurrency
local_recipient_maps = proxy:unix:passwd.byname $alias_maps
local_transport = local:$myhostname
luser_relay =
mail_name = Postfix
mail_owner = postfix
mail_release_date = 20100319
mail_spool_directory = /var/mail
mail_version = 2.6.6
mailbox_command =
mailbox_command_maps =
mailbox_delivery_lock = fcntl, dotlock
mailbox_size_limit = 51200000
mailbox_transport =
mailbox_transport_maps =
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maps_rbl_domains =
maps_rbl_reject_code = 554
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions =
master_service_disable =
max_idle = 100s
max_use = 100
maximal_backoff_time = 4000s
maximal_queue_lifetime = 5d
message_reject_characters =
message_size_limit = 10240000
message_strip_characters =
milter_command_timeout = 30s
milter_connect_macros = j {daemon_name} v
milter_connect_timeout = 30s
milter_content_timeout = 300s
milter_data_macros = i
milter_default_action = tempfail
milter_end_of_data_macros = i
milter_end_of_header_macros = i
milter_helo_macros = {tls_version} {cipher} {cipher_bits} {cert_subject} {cert_issuer}
milter_macro_daemon_name = $myhostname
milter_macro_v = $mail_name $mail_version
milter_mail_macros = i {auth_type} {auth_authen} {auth_author} {mail_addr} {mail_host} {mail_mailer}
milter_protocol = 6
milter_rcpt_macros = i {rcpt_addr} {rcpt_host} {rcpt_mailer}
milter_unknown_command_macros =
mime_boundary_length_limit = 2048
mime_header_checks = $header_checks
mime_nesting_limit = 100
minimal_backoff_time = 300s
multi_instance_directories =
multi_instance_enable = no
multi_instance_group =
multi_instance_name =
multi_instance_wrapper =
multi_recipient_bounce_reject_code = 550
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = localdomain
myhostname = localhost.localdomain
mynetworks = 127.0.0.0/8 [::1]/128
mynetworks_style = subnet
myorigin = $myhostname
nested_header_checks = $header_checks
newaliases_path = /usr/bin/newaliases.postfix
non_fqdn_reject_code = 504
non_smtpd_milters =
notify_classes = resource, software
owner_request_special = yes
parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,relay_domains,smtpd_access_maps
permit_mx_backup_networks =
pickup_service_name = pickup
plaintext_reject_code = 450
postmulti_control_commands = reload flush
postmulti_start_commands = start
postmulti_stop_commands = stop abort drain quick-stop
prepend_delivered_header = command, file, forward
process_id_directory = pid
propagate_unmatched_extensions = canonical, virtual
proxy_interfaces =
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps
proxy_write_maps = $smtp_sasl_auth_cache_name $lmtp_sasl_auth_cache_name
proxymap_service_name = proxymap
proxywrite_service_name = proxywrite
qmgr_clog_warn_time = 300s
qmgr_fudge_factor = 100
qmgr_message_active_limit = 20000
qmgr_message_recipient_limit = 20000
qmgr_message_recipient_minimum = 10
qmqpd_authorized_clients =
qmqpd_client_port_logging = no
qmqpd_error_delay = 1s
qmqpd_timeout = 300s
queue_directory = /var/spool/postfix
queue_file_attribute_count_limit = 100
queue_minfree = 0
queue_run_delay = 300s
queue_service_name = qmgr
rbl_reply_maps =
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
receive_override_options =
recipient_bcc_maps =
recipient_canonical_classes = envelope_recipient, header_recipient
recipient_canonical_maps =
recipient_delimiter =
reject_code = 554
reject_tempfail_action = defer_if_permit
relay_clientcerts =
relay_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
relay_destination_concurrency_limit = $default_destination_concurrency_limit
relay_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
relay_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
relay_destination_rate_delay = $default_destination_rate_delay
relay_destination_recipient_limit = $default_destination_recipient_limit
relay_domains = prueba.com
relay_domains_reject_code = 554
relay_initial_destination_concurrency = $initial_destination_concurrency
relay_recipient_maps =
relay_transport = relay
relayhost = 192.168.1.101
relocated_maps =
remote_header_rewrite_domain =
require_home_directory = no
resolve_dequoted_address = yes
resolve_null_domain = no
resolve_numeric_domain = no
rewrite_service_name = rewrite
sample_directory = /usr/share/doc/postfix-2.6.6/samples
send_cyrus_sasl_authzid = no
sender_bcc_maps =
sender_canonical_classes = envelope_sender, header_sender
sender_canonical_maps =
sender_dependent_relayhost_maps =
sendmail_path = /usr/sbin/sendmail.postfix
service_throttle_time = 60s
setgid_group = postdrop
show_user_unknown_table_name = yes
showq_service_name = showq
smtp_always_send_ehlo = yes
smtp_bind_address =
smtp_bind_address6 =
smtp_body_checks =
smtp_cname_overrides_servername = no
smtp_connect_timeout = 30s
smtp_connection_cache_destinations =
smtp_connection_cache_on_demand = yes
smtp_connection_cache_time_limit = 2s
smtp_connection_reuse_time_limit = 300s
smtp_data_done_timeout = 600s
smtp_data_init_timeout = 120s
smtp_data_xfer_timeout = 180s
smtp_defer_if_no_mx_address_found = no
smtp_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
smtp_destination_concurrency_limit = $default_destination_concurrency_limit
smtp_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
smtp_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
smtp_destination_rate_delay = $default_destination_rate_delay
smtp_destination_recipient_limit = $default_destination_recipient_limit
smtp_discard_ehlo_keyword_address_maps =
smtp_discard_ehlo_keywords =
smtp_enforce_tls = no
smtp_fallback_relay = $fallback_relay
smtp_generic_maps =
smtp_header_checks =
smtp_helo_name = $myhostname
smtp_helo_timeout = 300s
smtp_host_lookup = dns
smtp_initial_destination_concurrency = $initial_destination_concurrency
smtp_line_length_limit = 990
smtp_mail_timeout = 300s
smtp_mime_header_checks =
smtp_mx_address_limit = 5
smtp_mx_session_limit = 2
smtp_nested_header_checks =
smtp_never_send_ehlo = no
smtp_pix_workaround_delay_time = 10s
smtp_pix_workaround_maps =
smtp_pix_workaround_threshold_time = 500s
smtp_pix_workarounds = disable_esmtp,delay_dotcrlf
smtp_quit_timeout = 300s
smtp_quote_rfc821_envelope = yes
smtp_randomize_addresses = yes
smtp_rcpt_timeout = 300s
smtp_rset_timeout = 20s
smtp_sasl_auth_cache_name =
smtp_sasl_auth_cache_time = 90d
smtp_sasl_auth_enable = no
smtp_sasl_auth_soft_bounce = yes
smtp_sasl_mechanism_filter =
smtp_sasl_password_maps =
smtp_sasl_path =
smtp_sasl_security_options = noplaintext, noanonymous
smtp_sasl_tls_security_options = $smtp_sasl_security_options
smtp_sasl_tls_verified_security_options = $smtp_sasl_tls_security_options
smtp_sasl_type = cyrus
smtp_send_xforward_command = no
smtp_sender_dependent_authentication = no
smtp_skip_5xx_greeting = yes
smtp_skip_quit_response = yes
smtp_starttls_timeout = 300s
smtp_tls_CAfile =
smtp_tls_CApath =
smtp_tls_cert_file =
smtp_tls_ciphers = export
smtp_tls_dcert_file =
smtp_tls_dkey_file = $smtp_tls_dcert_file
smtp_tls_eccert_file =
smtp_tls_eckey_file = $smtp_tls_eccert_file
smtp_tls_enforce_peername = yes
smtp_tls_exclude_ciphers =
smtp_tls_fingerprint_cert_match =
smtp_tls_fingerprint_digest = md5
smtp_tls_key_file = $smtp_tls_cert_file
smtp_tls_loglevel = 0
smtp_tls_mandatory_ciphers = medium
smtp_tls_mandatory_exclude_ciphers =
smtp_tls_mandatory_protocols = SSLv3, TLSv1
smtp_tls_note_starttls_offer = no
smtp_tls_per_site =
smtp_tls_policy_maps =
smtp_tls_protocols = !SSLv2
smtp_tls_scert_verifydepth = 9
smtp_tls_secure_cert_match = nexthop, dot-nexthop
smtp_tls_security_level =
smtp_tls_session_cache_database =
smtp_tls_session_cache_timeout = 3600s
smtp_tls_verify_cert_match = hostname
smtp_use_tls = no
smtp_xforward_timeout = 300s
smtpd_authorized_verp_clients = $authorized_verp_clients
smtpd_authorized_xclient_hosts =
smtpd_authorized_xforward_hosts =
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_connection_count_limit = 50
smtpd_client_connection_rate_limit = 0
smtpd_client_event_limit_exceptions = ${smtpd_client_connection_limit_exceptions:$mynetworks}
smtpd_client_message_rate_limit = 0
smtpd_client_new_tls_session_rate_limit = 0
smtpd_client_port_logging = no
smtpd_client_recipient_rate_limit = 0
smtpd_client_restrictions =
smtpd_data_restrictions =
smtpd_delay_open_until_valid_rcpt = yes
smtpd_delay_reject = yes
smtpd_discard_ehlo_keyword_address_maps =
smtpd_discard_ehlo_keywords =
smtpd_end_of_data_restrictions =
smtpd_enforce_tls = no
smtpd_error_sleep_time = 1s
smtpd_etrn_restrictions =
smtpd_expansion_filter = \t\40!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~
smtpd_forbidden_commands = CONNECT GET POST
smtpd_hard_error_limit = ${stress?1}${stress:20}
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_history_flush_threshold = 100
smtpd_junk_command_limit = ${stress?1}${stress:100}
smtpd_milters =
smtpd_noop_commands =
smtpd_null_access_lookup_key = <>
smtpd_peername_lookup = yes
smtpd_policy_service_max_idle = 300s
smtpd_policy_service_max_ttl = 1000s
smtpd_policy_service_timeout = 100s
smtpd_proxy_ehlo = $myhostname
smtpd_proxy_filter =
smtpd_proxy_timeout = 100s
smtpd_recipient_limit = 1000
smtpd_recipient_overshoot_limit = 1000
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = no
smtpd_restriction_classes =
smtpd_sasl_auth_enable = no
smtpd_sasl_authenticated_header = no
smtpd_sasl_exceptions_networks =
smtpd_sasl_local_domain =
smtpd_sasl_path = smtpd
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = $smtpd_sasl_security_options
smtpd_sasl_type = cyrus
smtpd_sender_login_maps =
smtpd_sender_restrictions =
smtpd_soft_error_limit = 10
smtpd_starttls_timeout = 300s
smtpd_timeout = ${stress?10}${stress:300}s
smtpd_tls_CAfile =
smtpd_tls_CApath =
smtpd_tls_always_issue_session_ids = yes
smtpd_tls_ask_ccert = no
smtpd_tls_auth_only = no
smtpd_tls_ccert_verifydepth = 9
smtpd_tls_cert_file =
smtpd_tls_ciphers = export
smtpd_tls_dcert_file =
smtpd_tls_dh1024_param_file =
smtpd_tls_dh512_param_file =
smtpd_tls_dkey_file = $smtpd_tls_dcert_file
smtpd_tls_eccert_file =
smtpd_tls_eckey_file = $smtpd_tls_eccert_file
smtpd_tls_eecdh_grade = none
smtpd_tls_exclude_ciphers =
smtpd_tls_fingerprint_digest = md5
smtpd_tls_key_file = $smtpd_tls_cert_file
smtpd_tls_loglevel = 0
smtpd_tls_mandatory_ciphers = medium
smtpd_tls_mandatory_exclude_ciphers =
smtpd_tls_mandatory_protocols = SSLv3, TLSv1
smtpd_tls_protocols =
smtpd_tls_received_header = no
smtpd_tls_req_ccert = no
smtpd_tls_security_level =
smtpd_tls_session_cache_database =
smtpd_tls_session_cache_timeout = 3600s
smtpd_tls_wrappermode = no
smtpd_use_tls = no
soft_bounce = no
stale_lock_time = 500s
stress =
strict_7bit_headers = no
strict_8bitmime = no
strict_8bitmime_body = no
strict_mailbox_ownership = yes
strict_mime_encoding_domain = no
strict_rfc821_envelopes = no
sun_mailtool_compatibility = no
swap_bangpath = yes
syslog_facility = mail
syslog_name = ${multi_instance_name:postfix}${multi_instance_name?$multi_instance_name}
tcp_windowsize = 0
tls_daemon_random_bytes = 32
tls_eecdh_strong_curve = prime256v1
tls_eecdh_ultra_curve = secp384r1
tls_export_cipherlist = ALL:+RC4:@STRENGTH
tls_high_cipherlist = ALL:!EXPORT:!LOW:!MEDIUM:+RC4:@STRENGTH
tls_low_cipherlist = ALL:!EXPORT:+RC4:@STRENGTH
tls_medium_cipherlist = ALL:!EXPORT:!LOW:+RC4:@STRENGTH
tls_null_cipherlist = eNULL:!aNULL
tls_random_bytes = 32
tls_random_exchange_name = ${data_directory}/prng_exch
tls_random_prng_update_period = 3600s
tls_random_reseed_period = 3600s
tls_random_source = dev:/dev/urandom
trace_service_name = trace
transport_maps =
transport_retry_time = 60s
trigger_timeout = 10s
undisclosed_recipients_header = To: undisclosed-recipients:;
unknown_address_reject_code = 450
unknown_address_tempfail_action = $reject_tempfail_action
unknown_client_reject_code = 450
unknown_helo_hostname_tempfail_action = $reject_tempfail_action
unknown_hostname_reject_code = 450
unknown_local_recipient_reject_code = 550
unknown_relay_recipient_reject_code = 550
unknown_virtual_alias_reject_code = 550
unknown_virtual_mailbox_reject_code = 550
unverified_recipient_defer_code = 450
unverified_recipient_reject_code = 450
unverified_recipient_reject_reason =
unverified_recipient_tempfail_action = $reject_tempfail_action
unverified_sender_defer_code = 450
unverified_sender_reject_code = 450
unverified_sender_reject_reason =
unverified_sender_tempfail_action = $reject_tempfail_action
verp_delimiter_filter = -=+
virtual_alias_domains = $virtual_alias_maps
virtual_alias_expansion_limit = 1000
virtual_alias_maps = $virtual_maps
virtual_alias_recursion_limit = 1000
virtual_destination_concurrency_failed_cohort_limit = $default_destination_concurrency_failed_cohort_limit
virtual_destination_concurrency_limit = $default_destination_concurrency_limit
virtual_destination_concurrency_negative_feedback = $default_destination_concurrency_negative_feedback
virtual_destination_concurrency_positive_feedback = $default_destination_concurrency_positive_feedback
virtual_destination_rate_delay = $default_destination_rate_delay
virtual_destination_recipient_limit = $default_destination_recipient_limit
virtual_gid_maps =
virtual_initial_destination_concurrency = $initial_destination_concurrency
virtual_mailbox_base =
virtual_mailbox_domains = $virtual_mailbox_maps
virtual_mailbox_limit = 51200000
virtual_mailbox_lock = fcntl, dotlock
virtual_mailbox_maps =
virtual_minimum_uid = 100
virtual_transport = virtual
virtual_uid_maps =

尝试将 Gmail 配置为中继

我遵循了本指南中的每一步,现在在重新启动postfix服务并检查日志后,我得到了这个:

Jun 17 17:50:37 localhost postfix/postfix-script[17953]: stopping the Postfix mail system
Jun 17 17:50:37 localhost postfix/master[17903]: terminating on signal 15
Jun 17 17:50:37 localhost postfix/postfix-script[18025]: starting the Postfix mail system
Jun 17 17:50:37 localhost postfix/master[18026]: daemon started -- version 2.6.6, configuration /etc/postfix
Jun 17 17:50:37 localhost postfix/qmgr[18029]: AB33EA4B38: from=<[email protected]>, size=1773, nrcpt=1 (queue active)
Jun 17 17:50:37 localhost postfix/smtp[18031]: fatal: open database /etc/postfix/sasl_passwd.db: Invalid argument
Jun 17 17:50:38 localhost postfix/master[18026]: warning: process /usr/libexec/postfix/smtp pid 18031 exit status 1
Jun 17 17:50:38 localhost postfix/master[18026]: warning: /usr/libexec/postfix/smtp: bad command startup -- throttling

我已经按照指南所说的在里面sasl_passwd.db输入nano sasl_passwd.db和写入这个内容来创建文件[smtp.gmail.com]:587 username:password(当然更改用户名:正确的密码值),我做错了什么?

centos
  • 1 个回答
  • 740 Views
Martin Hope
ReynierPM
Asked: 2014-05-20 10:52:06 +0800 CST

我的 VPS 和 Bitbucket 之间的 SSH 身份验证失败

  • 4

我正在尝试在我的 VPS 和 Bitbucket 之间设置 SSH 身份验证,以便通过 Capistrano(用于 Web 项目)和 Capifony(用于 Symfony2 项目)配置以后的自动部署,所以我按照以下步骤操作:

  1. 以 root 身份登录我的 VPS 并执行命令cd ~,然后我就/root回家了。
  2. 运行命令ssh-keygen -t rsa -C "[email protected]"
  3. 然后我通过运行命令将密钥添加到 ssh-agentssh-add ~/.ssh/id_rsa
  4. 最后,我尝试通过运行测试一切是否正常,ssh -T "[email protected]"@bitbucket.org但出现此错误:

权限被拒绝(公钥)。

我想念什么?有什么帮助或建议吗?

centos
  • 2 个回答
  • 2453 Views
Martin Hope
ReynierPM
Asked: 2014-04-05 06:30:04 +0800 CST

在 CentOS 6.5 x64 上进行 PHP 升级后 Apache 无法启动

  • 0

我有一个带有 CentOS 6.5 和 PHP 5.5.11 的开发人员服务器(来自 REMI repos 的最新版本)。今天我做了:

yum --enablerepo=remi,remi-php55 update

这更新了 Apache 和其他一些库,如 Mongo for PHP(我认为是 PECL)。更新后,我重新启动了我的httpd服务,并注意到它无法关闭 Apache。“显然”再次启动它更正了这一点,但现在我发现服务器无法正常工作 - 没有提供网页。

检查 Apache 日志会显示这一行:

PHP 致命错误:PHP 启动:为防止数据损坏,不允许在第 0 行的 Unknown 中打开 32 位平台上的 mongo.native_long 设置

也许我可以通过禁用或卸载该扩展程序来解决此问题,但由于我在某些地方使用该扩展程序,所以这不是一个真正的选择。

除了禁用扩展程序之外,有关如何解决此问题的任何建议?

编辑:为什么如果系统是 i686 而库是 i686 我得到了那个错误

我对 YUM 日志做了一些研究并看到了结果:

tail /var/log/yum.log
Apr 03 01:25:45 Updated: php-recode-5.5.11-1.el6.remi.i686
Apr 03 01:25:45 Updated: php-mbstring-5.5.11-1.el6.remi.i686
Apr 03 01:25:46 Updated: php-intl-5.5.11-1.el6.remi.i686
Apr 03 01:25:47 Updated: php-xml-5.5.11-1.el6.remi.i686
Apr 04 09:09:59 Updated: krb5-libs-1.10.3-15.el6_5.1.i686
Apr 04 09:10:00 Updated: httpd-tools-2.2.15-30.el6.centos.i686
Apr 04 09:10:07 Updated: php-pecl-mongo-1.5.0-1.el6.remi.5.5.i686
Apr 04 09:10:15 Updated: httpd-2.2.15-30.el6.centos.i686
Apr 04 09:10:16 Updated: krb5-workstation-1.10.3-15.el6_5.1.i686
Apr 04 09:10:21 Updated: krb5-devel-1.10.3-15.el6_5.1.i686

为什么如果图书馆是php-pecl-mongo-1.5.0-1.el6.remi.5.5.i686我得到那个错误?怎么了?

编辑2:降级有问题的扩展

由于以前的测试不起作用,我现在尝试按如下方式降级该库:

yum downgrade php-pecl-mongo-1.5.0-1.el6.remi.5.5.i686 --enablerepo=remi,remi-php55
Loaded plugins: fastestmirror, security
Setting up Downgrade Process
Loading mirror speeds from cached hostfile
 * base: centos.secrel.com.br
 * epel: mirror.cedia.org.ec
 * extras: centos.secrel.com.br
 * remi: mirror.1000mbps.com
 * remi-php55: mirror.1000mbps.com
 * updates: mirrors.ucr.ac.cr
Only Upgrade available on package: php-pecl-mongo-1.5.0-1.el6.remi.5.5.i686
Nothing to do

我不能,所以对这个也有帮助吗?

EDIT3:寻找 php.ini 位置

因此,由于 Ubuntu 和 CentOS 具有不同的配置,我坚持认为 Apache 可能正在使用另一个php.ini文件,但它使用了我更改的文件,见下文:

locate php.ini
/etc/php.ini
/etc/php.ini.rpmnew
/usr/share/doc/php-common-5.5.11/php.ini-development
/usr/share/doc/php-common-5.5.11/php.ini-production
/var/www/html/apps/portal_de_logistica/vendor/doctrine/cache/tests/travis/php.ini
/var/www/html/apps/portal_ingenieros/vendor/doctrine/cache/tests/travis/php.ini
/var/www/html/imaginamos/vendor/doctrine/cache/tests/travis/php.ini
/var/www/html/kraken/vendor/doctrine/cache/tests/travis/php.ini

在/etc/php.ini我在文件末尾有这个:

;Mongo
[mongodb]
mongo.native_long = 0
mongo.long_as_object = 1

我还通过执行 a 找到了任何可能导致问题的文件,但没有找到任何文件,ini_set()如下所示:

grep -R "mongo.native_long" /var/www/html/
grep: /var/www/html/apps/portal_de_logistica/web/bundles/acmedemo: No such file or directory

解决方案

因此,经过一些头痛后,我找到了解决方案:

yum remove php-pecl-mongo-1.5.0-1.el6.remi.5.5.i686
yum --enablerepo=remi,remi-php55 install php-devel.i686
pecl install mongo

添加“extension=mongo.so”php.ini之后我的 Apache 再次工作

centos
  • 2 个回答
  • 2134 Views
Martin Hope
ReynierPM
Asked: 2012-09-11 11:32:29 +0800 CST

从现有目录使用 SVN

  • 0

我正在按照本指南在我的开发服务器中安装和配置 SVN 服务器。我以前在 /var/www/html 下创建了一些项目,并希望这些项目在 SVN 下,这意味着我可以使用 Tortoise 或任何其他客户端将此代码与 SCM 一起使用。例如,在 /var/www/html/project1 上启动新回购的命令是什么?这个:svnadmin create testrepo ? 在配置回购协议并正常工作后,我必须如何配置 Apache DAV SVN 以允许 HTTP 访问?

apache-2.2
  • 1 个回答
  • 74 Views
Martin Hope
ReynierPM
Asked: 2012-08-08 13:28:20 +0800 CST

Apache user_dir 模块失败

  • 0

我正在尝试在我的 DEVSERVER 中设置 user_dir 模块,但每当我尝试访问任何 URL 时都会收到 404 Not found 错误,例如:

http://devserver/~reynierpm/

我的 userdir.conf 文件如下:

<IfModule mod_userdir.c>
    UserDir enabled guillermo reynierpm tomas

    <Directory /home/*/public_html>
      Options Indexes Includes FollowSymLinks
      AllowOverride All
      Allow from all
      Order deny,allow
    </Directory>
</IfModule>

我做错了什么?我正在运行带有最新 Apache 2.2.15 的 CentOS 6.3!!

apache-2.2
  • 1 个回答
  • 625 Views
Martin Hope
ReynierPM
Asked: 2012-06-27 13:51:07 +0800 CST

尝试安装 gitolite 时出错

  • 3

我正在尝试按照此http://sitaramc.github.com/gitolite/qi.html中的说明启动并运行 gitolite,但是当我运行命令时:

[git@devserver gitolite]$ src/gitolite install -ln
FATAL: errors found before logfile could be created
FATAL: die  unknown gitolite sub-command

我收到上面的错误,我做错了什么?我将 git 用户创建为:

useradd -d /data/gitrepos git

然后 cd 到 /data/gitrepos 并使用以下命令克隆 gitolite 存储库:

git clone git://github.com/sitaramc/gitolite

有什么建议吗?提前干杯并感谢

centos git repository gitolite
  • 1 个回答
  • 1775 Views
Martin Hope
ReynierPM
Asked: 2012-06-27 07:20:39 +0800 CST

格式化分区为 /home 无需重新安装

  • 0

我已经安装了 CentOS 6.2 服务器并进行了分区(大小接近):

Filesystem            Size  Used Avail Use% Mounted on
/dev/sda5              29G  2.8G   25G  11% /
tmpfs                 972M     0  972M   0% /dev/shm
/dev/sda2             485M   51M  409M  11% /boot
/dev/sdb1             294G  211M  279G   1% /data
/dev/sda3             4.9G  157M  4.5G   4% /home

现在我安装 gitosis 并且无法更改或不知道如何存储存储库,基本上在 $HOME/repositories 下,然后我想使用 /data (/dev/sdb1) 作为 /home 并释放 /home( /开发/sda3)。我可以在不重新安装整个系统的情况下这样做吗?有什么建议吗?

提前干杯并感谢

centos partition
  • 2 个回答
  • 259 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