背景:我刚刚获得了一份系统pipe理员的职位,我的雇主非常清楚,我是这个新人,所以他们让别人给我看看。 她的第一个任务是用CentOSbuild立一个虚拟机。 我在我的虚拟机上设置了CentOS,并且毫不意外地安装了Apache。 当我尝试使用主机上的浏览器通过IP地址访问它时,它表示响应时间太长(使用Google Chrome)。 我已经将虚拟机的networking适配器设置为桥接适配器,我没有使用这个回环地址。 我试过使用 curl myipaddress 它显示的HTML就好了。 我试图ping虚拟机的IP地址,它回复良好。 我试图排除iptables。 当我试图阻止它时,我得到了什么: Failed to stop iptables.service: Unit iptables.service not loaded. 进一步检查意味着没有安装iptables。 我试着检查服务的状态 sudo service httpd status 而且显然工作正常。 我基本上把设置保留在默认状态,所以我不确定我忽略了什么。 它看起来像一个configuration错误,但我不知道到底是什么。
我在我的个人服务器上设置了gitlab,并使用了这个答案和这个答案 (还有一些input来使它与我的apache安装一起工作。一切工作正常,当我去gitlab.example.com,我看到gitlab UI ,可以创build帐户等,但是当我检查了我转发的URI时,就是这样 https://gitlab.example.com//users/sign_in (注意域名后面的两个斜杠)。 这不是一个真正的问题,但我想知道这是为什么,我怎样才能解决这个问题 – 特别是因为当我从地址中删除一个斜线时,它工作的很好。 (所以https://gitlab.example.com/users/sign_in是完全一样的)。 事实上,我得到了两次转发: GET https://gitlab.example.com => 301 Moved Permanently Location:https://gitlab.example.com/ GET https://gitlab.example.com/ => 302 Found Location:https://gitlab.example.com//users/sign_in 这是我的apacheconfiguration文件(`/etc/apache2/sites-enabled/gitlab.conf): <IfModule mod_ssl.c> <VirtualHost *:443> ServerName gitlab.example.com ServerSignature Off ProxyPreserveHost On ProxyPassMatch ^(/[^/]+\.(html|png|ico|css|txt))$ ! ProxyPass /assets ! <Location /> Order deny,allow Allow from all ProxyPassReverse http://127.0.0.1:8080 ProxyPassReverse http://gitlab.example.com </Location> RewriteEngine on […]
我已经在CentOS 7.x环境下使用本教程编译了支持FPM的PHP 7。 我能够通过运行CLI来testingphp。 cd /opt/php7/bin ./php –version 哪个输出 PHP 7.0.6 (cli) (built: May 22 2016 07:20:48) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies 我也安装了Apache,它运行成功。 现在我已经创build了虚拟主机,并将域引导到一个目录。 我已经用函数phpinfo()粘贴了一个php文件info.php ,但是服务器输出PHP函数而不执行它。 我觉得我现在真的很接近,只需要configurationapache运行php-fpm,所以我把这个configuration放在httpd.conf文件中,但是没有帮助。 <IfModule mod_fastcgi.c> DirectoryIndex index.html index.shtml index.cgi […]
我有通配证书,我从我的一个Windows服务器上拉出来,试图把这个证书放到运行Apache的机器上。 我有包含私钥的pem文件以及4个标记为证书的块。 从我在网上读到的,我应该将密钥分离到它自己的文件file.key ,然后分离证书。 这是我感到困惑的地方:我是否需要将所有这些证书分离成单独的文件或只是一个.crt文件? 从那里我知道我需要修改Apache的configuration文件,但是我有一个名为httpd.conf的文件(我在线阅读的大部分文件都是要编辑的),而且我有另一个名为ssl.conf文件。 那么我应该把哪些部分放在编辑过的线上呢? 编辑过的行是这样的: SSLCertificateKeyFile /filepath SSLCertifaceFile /filepath
我试图将请求redirect到一个文件夹备份到我的Apache服务器的根目录中的一个文件, index.py 。 到目前为止没有任何工作。 这是我的.htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #RewriteCond %{HTTP_REFERER} !index\.py RewriteRule . index.py [L] </IfModule> 这仍然让我喂它的url,如www.example.com/files/testfile.zip和下载。 它需要回到index.py 。 我已经取消了httpd.conf mod_rewrite.co注释。 这是在Windows中。
我已经问过这个,但也许在这里更适合问。 我通过Pecl安装了GnuPG。 生成酒吧/私人密钥等..我有在php.ini extension=gnupg.so 当我尝试运行简单的代码时,我得到了未定义的gnupg_init()错误,据我了解,这意味着模块没有加载。 Fatal error: Uncaught Error: Call to undefined function gnupg_init() 这是我试图运行的代码 putenv('GNUPGHOME=/home/stan/.gnupg'); $res = gnupg_init(); gnupg_seterrormode($res,GNUPG_ERROR_WARNING); gnupg_addencryptkey($res,"myfingerprint"); $enc = gnupg_encrypt($res, "just a test"); echo $enc; 系统是ubuntu + apache。 这里是.gnupg/ srwxrwxr-x 1 stan stan 0 Aug 16 08:12 S.gpg-agent -rw——- 1 stan stan 32 Aug 16 10:02 pubring.kbx~ drwx—— 2 stan stan […]
我有这个configuration的Apache httpd 2.4testing实例: <VirtualHost *:9979> ServerName 192.168.0.162 # Encoded slashes need to be allowed AllowEncodedSlashes On # Container uses a unique non-signed certificate SSLProxyEngine On SSLProxyVerify None SSLProxyCheckPeerCN Off SSLProxyCheckPeerName Off # keep the host ProxyPreserveHost On # static html, js, images, etc. served from loolwsd # loleaflet is the client part of LibreOffice Online […]
我有一个网站使用.htaccess重写规则,但有些不起作用。 这是我的.htaccess文件: RewriteEngine On RewriteBase / # Inicio RewriteRule ^inicio|home|index$ index.php [QSA,L] # Paginacion amigable RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)\.([0-9]+)$ $1?pag=$2 [QSA,L] # Miniaturas RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*\/)?tdd([A-Za-z0-9_~-]*)\/(.*)$ imagen.php?param=$2&src=$1$3 [QSA,L] #paginas RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*-p([0-9]+)$ interna.php?id=$1 [QSA] #Intranet RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d […]
在Linux上使用Apache 2.4,与几个虚拟服务器,每个虚拟服务器与自己的DocumentRoot,我想为Apache主服务器ErrorDocument本地redirect执行一个单一的perl脚本相关的Apache主DocumentRoot,而不是每个下perl脚本虚拟服务器。 会发生什么是虚拟服务器的文档根被用来构build文件系统path,而不是主服务器的文档根。 有什么办法可以configurationApache服务器只使用一个本地redirect脚本,而不是(显然)必须在每个虚拟服务器的DocumentRoot中(相同)的脚本?
好的,我知道当我提出一个与“我的世界”有关的问题时,我冒着大量的失望。 如果在这个问题上有任何格式错误(我这里是你的第一个问题),我要求提前原谅。 我也花了10多个小时尝试和谷歌search,但我找不到任何解决我面临的问题。 但在这里呢: 我的设置包含两台服务器,一台用于托pipe网站,另一台用于完成繁重的工作(例如“我的世界”)。 我使用Spigot为一些插件供电,其中一个插件是dynmap(这是一个用于在线显示世界和玩家的交互式地图)。 有关dynmap的更多信息在这里: https : //github.com/webbukkit/dynmap 无论如何,我想在我的web服务器上使用ReverseProxy,并且代理dynmap内容,这样我就可以closures路由器上的一些端口。 目前我刚刚在端口8123上向我的Minecraft服务器做了端口转发。 在webbserver上,我正在运行apache2.4,并且已经安装了mod_proxy和mod_proxy_html。 我也在HTTP和HTTPS的vhost文件中定义了这个: ProxyRequests off ProxyPass "/map" "http://192.168.2.31:8123/" ProxyPassReverse "/map" "http://192.168.2.31:8123/" 这应该是相当自我解释。 但是当我访问页面[WEBSITE] /地图,我迎接一个白色的空白页面。 我得到这个你: <title>Minecraft Dynamic Map</title> <meta charset="utf-8" /> <meta name="keywords" content="minecraft, map, dynamic" /> <meta name="description" content="Minecraft Dynamic Map" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" /> <!– These 2 lines make […]