1、安装依赖软件
yum install gcc-c++
yum install make
yum install expat-devel
yum install perl
yum install curl-devel
yum install libxml2-devel
yum install libjpeg-devel
yum install libpng-devel
yum install freetype-devel
2. 下载相关安装包
wget https://archive.apache.org/dist/httpd/httpd-2.4.54.tar.gz
wget http://archive.apache.org/dist/apr/apr-1.7.0.tar.gz
wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz
wget https://sourceforge.net/projects/pcre/files/pcre/8.35/pcre-8.35.tar.gz
wget https://www.php.net/distributions/php-7.4.33.tar.gz
3.安装Apache及其依赖环境apr,apr-util,pcre
tar -zxvf apr-1.7.0.tar.gz
cd apr-1.7.0
./configure --prefix=/usr/local/apr
make && make install
tar -zxvf apr-util-1.6.1.tar.gz
cd apr-util-1.6.1
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make && make instal
tar -zxvf pcre-8.35.tar.gz
cd pcre-8.35
./configure --prefix=/usr/local/pcre
make && make install
tar -zxvf httpd-2.4.54.tar.gz
cp -r apr-1.7.0 httpd-2.4.54/srclib/apr
cp -r apr-util-1.6.1 httpd-2.4.54/srclib/apr-util
cd httpd-2.4.54
./configure \
--prefix=/usr/local/apache2 \
--enable-so \
--enable-rewrite \
--enable-ssl \
--enable-modules=most \
--enable-mpms-shared=all \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-pcre=/usr/local/pcre \
--with-mpm=event \
--with-included-apr
make && make install
4.安装PHP
wget https://www.php.net/distributions/php-7.4.33.tar.gz
tar -xvzf php-7.4.33.tar.gz
cd php-7.4.33
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs
make && make install
5.配置PHP和Apache相关联
PHP安装成功后会在apache的modules目录下生成一个libphp.so动态库文件
vim /usr/local/apache2/conf/httpd.conf #加入一行
LoadModule php7_module modules/libphp7.so
在Apache的配置文件httpd.conf的<IfModule mime_module></IfModule>块里增加一行
AddType application/x-httpd-php .php
配置index.php为默认执行的文件
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
6. 编写测试页面test.php
cd /usr/local/apache2/htdocs
vim test.php
<?
phpinfo()
?>
7.访问测试页面,在浏览器输入服务器ip地址 http://192.168.174.132/test.php
8. 安装和配置dokuwiki
wget -c http://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz
tar -xvzf dokuwiki-stable.tgz
cp -r dokuwiki-2022-07-31a /usr/local/apache2/htdocs/dokuwiki
浏览器访问 http://192.168.174.132/dokuwiki/install.php,配置dokuwiki
9. 配置玩wiki后,就可以访问了http://192.168.174.132/dokuwiki
发表评论 取消回复