Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Apache static page

2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

Apache opens a static page

Unsolved pits for bloggers:

I built LAMP for the first time by compiling and installing HTTPD service. When I opened the static page, I found that there was no LoadModule rewrite_module libexec/mod_rewrite.so code in httpd.conf. I manually added it to restart apache Times.

Viewing the file .htaccess is also normal:

# BEGIN WordPressRewriteEngine OnRewriteBase / RewriteRule ^ index\ .php $- [L] RewriteCond% {REQUEST_FILENAME}!-fRewriteCond% {REQUEST_FILENAME}!-dRewriteRule. / index.php [L]

The version and parameters for compiling and installing httpd are as follows:

# wget https://mirrors.tuna.tsinghua.edu.cn/apache/httpd/httpd-2.2.31.tar.gz#tar xf httpd-2.2.31.tar.gz # cd httpd-2.2.31#yum install zlib zlib-devel-y./configure\-prefix=/application/apache2.2.31\-- enable-deflate\-- enable-expires\-- enable-headers\-- enable-modules=most\-- enable-so\-- with-mpm=worker\-- enable-rewrite#make#make install

In short, the problem is to be solved.

Based on the principle of simplicity, ease of use and high efficiency, I suggest using yum installation.

Apache implements the actual operation of static pages:

In the configuration file httpd.conf:

Change AllowOverride None to AllowOverride All

There should be LoadModule rewrite_module libexec/mod_rewrite.so in the file. If there is a # comment in front of the code, remove the comment, and if there is no such code, add it manually.

.htaccess file:

# BEGIN WordPressRewriteEngine OnRewriteBase / RewriteRule ^ index\ .php $- [L] RewriteCond% {REQUEST_FILENAME}!-fRewriteCond% {REQUEST_FILENAME}!-dRewriteRule. / index.php [L]

If there is no above code in the file, add it to the file manually.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report