先搭建lamp环境

先需要相应的环境包
libmcrypt-2.5.8.tar.gz, httpd-2.2.17.tar.gz, mediawiki-1.30.0.tar.gz ,mysql-5.5.22.tar.gz

解压apache相关的httpd
[[email protected] src]# tar -zxf httpd-2.2.17.tar.gz
[[email protected] src]# cd httpd-2.2.17
进行编译安装
[[email protected] httpd-2.2.17]# ./configure --prefix=/data/server/httpd --enable-so --enable-rewrite --enable-charset-lite --enable-cgi 如果无法编译 则缺 gcc gcc-c++ 语言编译包用yum安装即可
[[email protected] httpd-2.2.17]# make && make install
优化路径
[[email protected] httpd-2.2.17]# cd /data/server/httpd/bin
[[email protected] bin]# ln -s /data/server/httpd/bin/* /usr/local/bin/
开启apache 和关闭防火墙
[[email protected] bin]# apachectl start
[[email protected] bin]# systemctl stop firewalld
网页输入自己的IP
Centos Media wiki
安装mysql
先将相关依赖包用yum安装好
[[email protected] server]# yum -y install ncurses-devel
[[email protected] server]# yum -y install cmake
创建用户和属组
[[email protected] server]#groupadd mysql
[[email protected] server]# useradd -s /sbin/nologin -M -g mysql mysql
解压mysql
[[email protected] server]# tar -zxf mysql-5.5.22.tar.gz
[[email protected] server]# cd mysql-5.5.22
编译安装
[[email protected] mysql-5.5.22]# cmake -DCMAKE_INSTALL_PREFIX=/data/server/mysql -DSYSCONFDIR=/etc/ -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all
[[email protected] mysql-5.5.22]# make -j4 && make install
给数据库权限 并进行配置
[[email protected] mysql-5.5.22]# chown -R mysql:mysql /data/server/mysql/
[[email protected] mysql-5.5.22]# cp support-files/my-medium.cnf /etc/my.cnf
[[email protected] mysql-5.5.22]# /data/server/mysql/scripts/mysql_install_db --user=mysql --basedir=/data/server/mysql --datadir=/data/server/mysql/data/
添加系统文件
[[email protected] mysql-5.5.22]# cp support-files/mysql.server /etc/init.d/mysqld
[[email protected] mysql-5.5.22]# chmod a+x /etc/init.d/mysqld
[[email protected] mysql-5.5.22]# chkconfig --add mysqld
设置变量环境
[[email protected] mysql-5.5.22]# echo “PATH=$PATH:/data/server/mysql/bin” /etc/profile
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/data/server/mysql/bin /etc/profile
[[email protected] mysql-5.5.22]# . /etc/profile
开启服务 和登录mysql
[[email protected] mysql-5.5.22]# systemctl start mysqld
[[email protected] mysql-5.5.22]#mysql -u root -p

Centos Media wiki
创建wiki数据库和权限
mysql> create database wikidb;
Query OK, 1 row affected (0.03 sec)

mysql> grant all on wikidb.* to root;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on wikidb.* to [email protected];
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on wikidb.* to wikiuser;
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on wikidb.* to [email protected];
Query OK, 0 rows affected (0.00 sec)

mysql> set password for [email protected]=password(‘123’);
Query OK, 0 rows affected (0.01 sec)

mysql> quit
Bye

安装php
安装相应的依赖关系
[[email protected] server]#yum -y install bzip2-devel libcurl-devel readline-devel openssl-devel libxml2-devel
[[email protected] server]#tar zxf libmcrypt-2.5.8.tar.gz
[[email protected] server]#cd libmcrypt-2.5.8
[[email protected] server]#./configure
[[email protected] server]#make && make install
编译安装php
[email protected] server]#tar -zxf php-7.2.0.tar.gz
[[email protected] server]#cd php-7.2.0/
[[email protected] php-7.2.0 ]#./configure --prefix=/data/server/php --enable-fpm --with-apxs2=/data/server/httpd/bin/apxs --with-config-file-path=/etc --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-opcache=no --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-gettext --enable-mbstring --with-iconv --with-mcrypt --with-mhash --with-openssl --enable-bcmath --enable-soap --with-libxml-dir --enable-pcntl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-sockets --with-curl --with-zlib --enable-zip --with-bz2 --with-readline --without-sqlite3 --without-pdo-sqlite --with-pear
[[email protected] php-7.2.0 ]#make -j4 && make install
配置文件
[[email protected] php-7.2.0 ]#cp php.ini-development /data/server/php/etc/php.ini
[[email protected] php-7.2.0 ]#cp /data/server/php/etc/php-fpm.conf.default /data/server/php/etc/php-fpm.conf
[[email protected] php-7.2.0 ]#cp /data/server/php/etc/php-fpm.d/www.conf.default /data/server/php/etc/php-fpm.d/www.conf
创建用户
[[email protected] php-7.2.0 ]#groupadd www
[[email protected] php-7.2.0 ]#useradd -s /sbin/nologin -M -g www www
添加系统和开启
[[email protected] php-7.2.0 ]#cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
[[email protected] php-7.2.0 ]#chmod +x /etc/init.d/php-fpm
[[email protected] php-7.2.0 ]#/etc/init.d/php-fpm start
修改配置
[[email protected] php-7.2.0 ]#vim /data/server/httpd/conf/httpd.conf
54#LoadModule php7_module modules/libphp7.so
55 LoadModule php7_module modules/libphp7.so
98 ServerName www.example.com:80
167 #在此行下添加index.php
168 DirectoryIndex index.php index.html
309 AddType application/x-compress .Z
310 AddType application/x-gzip .gz .tgz
311 AddType application/x-httpd-php .php
[[email protected] php-7.2.0 ]#vim /data/server/httpd/htdocs/cui.php
Centos Media wiki
开启apache
[[email protected] php-7.2.0 ]apachectl restart
进入浏览器
Centos Media wiki
安装 Media wiki
[[email protected] server]#tar zxf mediawiki-1.30.0.tar.gz.gz
[[email protected] server]#mv mediawiki-1.30.0 /data/server/httpd/htdocs/wiki2
验证
Centos Media wiki

相关文章:

  • 2021-12-19
  • 2021-11-18
  • 2021-07-25
  • 2021-12-26
  • 2022-02-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-22
  • 2021-11-01
  • 2021-07-30
  • 2021-06-26
  • 2021-05-01
  • 2022-12-23
相关资源
相似解决方案