Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Apache static page

Shulou Source: shulou.com Published: 2022-06-01 09:04:01 09月18日 Update

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.

Tags: Files code static pages manual comments compilation principles parameters actual suggestions times versions issues ease of use services configuration Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Docker Shulou Information Microsoft NVidia