尝试在 EC2 中设置 wordpress。在网上找到了几个教程并尝试了。他们是设置 apache、php、mysql 的几个步骤。一件事是按照命令安装 httpd
yum install httpd
Run Code Online (Sandbox Code Playgroud)
但我无法安装收到以下消息
Setting up Install Process
No package httpd available.
Nothing to do
Run Code Online (Sandbox Code Playgroud)
如何安装httpd并运行apache服务器
运行 yum repolist enabled 后,我得到了这个结果
repolist: 0
Run Code Online (Sandbox Code Playgroud) .htaccess 起初运行良好,然后我在 .htacess 中添加了两行以启用 RewriteLog。结果是我无法打开我的网站。
我添加到我的 .htaccess 中的两行如下:
RewriteLog /home/bigmeow/mylog/rewrite.log
RewriteLogLevel 9
Run Code Online (Sandbox Code Playgroud)
启用 rewritelog 的 .htaccess 如下:
less .htaccess
RewriteEngine On
RewriteBase /blog/
RewriteLog /home/bigmeow/mylog/rewrite.log
RewriteLogLevel 9
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
Run Code Online (Sandbox Code Playgroud)
当我尝试打开我的网站时收到的错误消息:
Internal Server Error
The server encountered an …Run Code Online (Sandbox Code Playgroud) 有几件事要添加到标题中。
假设我们有一个域foo.com和一个域bar.com,我们希望第一个由 apache 提供服务,第二个由 nginx 提供服务(两者都运行在同一台机器上,请考虑使用其他 Web 服务器的可能性,例如 lighthttpd),并且我们希望它们只需写入 URL 而无需指定任何端口即可访问(至少在客户端,但服务器端的重定向是可以接受的)。
那可能吗?如何完成这样的事情?我不知道从哪里开始和谷歌搜索我只能找到如何在同一台服务器上托管多个域......这不是我想要的。
我有一个 linux apache 服务器,它在几天前运行良好。发生的事情是从访问日志中有这样的行,并且日志文件每秒增长很多行。最初我怀疑服务器被dos攻击并停止了服务器。但是几天后,每当我启动服务器时,都会发生类似的日志。我想知道是否有人知道发生了什么?它是由病毒引起的吗?
23.19.76.217 - - [17/Oct/2012:10:21:47 -0400] "GET http://ad.globe7.com/st?ad_type=iframe&ad_size=728x90§ion=3633732&pub_url=${PUB_URL} HTTP/1.0" 200 4497
142.54.177.114 - - [17/Oct/2012:10:21:47 -0400] "GET http://ad.globe7.com/imp?Z=300x250&s=3582878&T=3&_salt=3106601030&B=12&m=2&u=http%3A%2F%2Fwww.homesearchcar.com%2F%3Fp%3D184&r=1 HTTP/1.0" 302 -
Run Code Online (Sandbox Code Playgroud) 我试图创建一个别名或虚拟主机以作为不同的用户运行。下面是httpd.conf不起作用的 apache 的一部分。或者,它甚至可能吗?
<VirtualHost blah:80>
user DifferentUser
group DifferentGroup
ServerAdmin blah
DocumentRoot blah
ServerName blah
ServerAlias blah
ScriptAlias /cgi-bin/ blah
DirectoryIndex index.html index.htm default.htm index.shtml index.php
ErrorLog logs/blah-error_log
CustomLog logs/blah-access_log common
<Directory "/blah/">
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride all
Order Deny,Allow
Deny from none
Allow from all
</Directory>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud) 这是紧急情况。
我只想做一件愚蠢而简单的事情。我不想有 dom 日志。就是这样。
所以我编辑 vconf.local 并重建 httpd.conf。
出现一些错误,例如一个域存在所有权冲突。所以呢?我只是继续并重新启动apache
root@host [/var/cpanel/templates/apache2]# vi vhost.local
root@host [/var/cpanel/templates/apache2]# /usr/local/cpanel/bin/apache_conf_distiller --update
info [apache_conf_distiller] 'local' datastore in use (/var/cpanel/conf/apache/local)
info [apache_conf_distiller] Missing IP for domain host.buildingsuperteams.com, using 67.159.44.4
info [apache_conf_distiller] Missing port for domain host.buildingsuperteams.com, using 80
info [apache_conf_distiller] Missing user for domain host.buildingsuperteams.com, using nobody
info [apache_conf_distiller] Missing group for domain host.buildingsuperteams.com, using nobody
info [apache_conf_distiller] Missing ServerName for domain host.buildingsuperteams.com, using host.buildingsuperteams.com
info [apache_conf_distiller] Domain ownership conflict detected for buildingsuperteams.com, users nobody, building …Run Code Online (Sandbox Code Playgroud) 这是我第一次在 Ubuntu 12.04 上使用 Amazon EC2 Linux 微型实例。
我注意到它默认没有安装 Apache,所以我安装了sudo apt-get install apache2. 安装后,/var/www/index.html存在并且我验证了 Apache2 正在运行。
当我这样做时curl http://localhost:80,它成功地返回了/var/www/index.html.
但是,当我在浏览器中输入公共 DNS 名称时出现page not found错误。
为什么不index.html加载以及解决此问题的方法是什么?
我一直在努力让它发挥作用,但我无法解决它。我想要做的是根据 CloudFlare 添加的 CF-IPCountry 标头阻止来自多个国家/地区的站点访问。我认为 htaccess 是一个合适的方法来做到这一点。
我们在 DirectAdmin 之上为控制面板运行 LiteSpeed 4.2.4。
我们遇到的问题是 htaccess 规则似乎没有做任何事情。
这是我们尝试的规则:
SetEnvIf CF-IPCountry AU UnwantedCountry=1
Order allow,deny
Deny from env=UnwantedCountry
Allow from all
Run Code Online (Sandbox Code Playgroud)
这根本没有区别,连接仍然被接受。只是为了检查规则是否至少正在处理,我将允许从全部更改为从全部拒绝,并且连接被拒绝。所以这似乎是变量的问题。
这是请求中的相关标头。
Connection: Keep-Alive
Accept-Encoding: gzip
CF-Connecting-IP: xx.xx.xx.xx
CF-IPCountry: AU
X-Forwarded-For: xx.xx.xx.xx.xx
CF-RAY: c9062956e2d04b6
X-Forwarded-Proto: http
CF-Visitor: {"scheme":"http"}
Zone-Name: xx.com.au
Run Code Online (Sandbox Code Playgroud)
希望有人能帮助我,这让我发疯太久了。
谢谢
更新
我现在通过将 RewriteLogLevel 9 添加到虚拟主机来启用重写日志记录。
最初我使用我所有其他的 htaccess 规则运行测试,这些规则对于这个站点来说非常广泛,我可以看到所有的匹配项都被记录下来,所以我知道日志记录工作正常。
为了测试这个案例,我将我的 htaccess 剥离到裸露的骨头,所以我的 htaccess 中有以下内容:
SetEnvIf CF-IPCountry AU UnwantedCountry=1
Order allow,deny
Deny from env=UnwantedCountry
Allow from all
Run Code Online (Sandbox Code Playgroud)
在我的 htaccess 中,根本没有日志输出,这对我说它根本不符合我猜测的规则。我再次验证标题中存在“CF-IPCountry: AU”。
我无法在运行 centos 6.5 的 VPS 上终止 httpd 进程。
我尝试用 -9 标志杀死它,但也不起作用。
命令的输出: ps aux | grep httpd
root 29459 0.0 0.0 103252 828 pts/0 S+ 11:24 0:00 grep httpd
Run Code Online (Sandbox Code Playgroud)
奇怪的是,每次输入kill -9 29459命令,上述进程的pid加2,kill命令返回No such process
在此之前发生的事情是我尝试重新启动 httpd 但由于 SSL 错误无法重新启动
任何帮助,将不胜感激。
我刚刚使用下面的代码卸载了 Litespeed,但是当我尝试通过 httpd 启动 Apache 时出现错误。我能做什么?
这是我使用的命令:
root@s15430558 [~]# /usr/local/lsws/admin/misc/uninstall.sh
WARNING:
All sub directories under "/usr/local/lsws"
created during installation will be removed!
However, conf/ and logs/ can be optionally preserved.
If you want to preserve any file under the other sub-directories created
by installation script, please backup before proceeding.
Manually created sub-directories under "/usr/local/lsws"
will not be touched.
Do you want to uninstall LiteSpeed Web Server? [y/N] y
Uninstalling rc scripts ...
[OK] The startup script has been successfully uninstalled! …Run Code Online (Sandbox Code Playgroud) 我正在使用 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 …Run Code Online (Sandbox Code Playgroud) 有人试过在 CentOS7/httpd 上安装 mod_fastcgi 吗?
由于它不在 epel 或 fusion 存储库中,我尝试了 el6 rpm,它不起作用(httpd 说:无法将模块/mod_fastcgi.so 加载到服务器中:/etc/httpd/modules/mod_fastcgi.so:未定义符号:unixd_config )。
从源代码编译 mod_fastcgi (# make top_dir=/usr/lib64/httpd) 也失败了,出现了数千个这样的错误:
/usr/include/httpd/http_config.h:574:32: error: request for member 'connection' in something not a structure or union
mod_fastcgi.c:2881:5: warning: passing argument 6 of 'ap_log_rerror_' from incompatible pointer type [enabled by default]
ap_log_rerror(FCGI_LOG_ERR_NOERRNO, r, "FastCGI: access denied: %s", r->uri);
Run Code Online (Sandbox Code Playgroud)
SELINUX 已被禁用(以排除“拒绝访问”的原因)
我还安装了编译fastcgi的要求:httpd-devel libtool make gcc apr apr-devel。
由于 mod_fastcgi 恕我直言是连接到 PHP-FPM 的常用方法,我真的无法想象 fastcgi 不适用于 CentOS 7,所以我认为我做错了什么。
不幸的是,mod_proxy 对套接字连接的支持从 httpd 2.4.10 开始,而 CentOS 7 存储库只有 …
httpd ×12
apache-2.2 ×6
.htaccess ×2
amazon-ec2 ×2
centos7 ×2
litespeed ×2
alias ×1
apache-2.4 ×1
centos ×1
ddos ×1
fastcgi ×1
flooding ×1
httpd.conf ×1
kill-process ×1
mod-fastcgi ×1
mod-rewrite ×1
php ×1
ssh ×1
ssl ×1
wordpress ×1