wiki

  1. 1. yum install httpd php pcre php-mysql php-pear php-pecl-apc mysql-server ImageMagick sendmail php-intl wget system-config-firewall-tui  
  2.   
  3. 2. service mysqld start  
  4.   
  5. 3./usr/bin/mysql_secure_installation  
  6.   
  7. 4.登陆mysql,建立用户和密码如下:  
  8.   
  9. insert into mysql.user(Host,User,Password) values("localhost","mediawiki",password("1234"));  
  10.   
  11. 5. 建立数据库并赋权:  
  12. create database wikidb;  
  13. grant index, create, select, insert, update, delete, alter, lock tables on wikidb.* to 'mediawiki'@'localhost' identified by '1234';  
  14. exit;  
  15.   
  16. 远程访问赋权:  
  17. grant all privileges on *.* to 'mediawiki'@'192.168.88.84' identified by '1234';  
  18. FLUSH PRIVILEGES;  
  19.   
  20. 6.cd /var/www/html  
  21.   
  22. 7.wget http://download.wikimedia.org/mediawiki/1.18/mediawiki-1.18.2.tar.gz  
  23.   
  24. 8.tar xzpf mediawiki-1.18.2.tar.gz  
  25.   
  26. 9.mv mediawiki-1.18.2 wiki  
  27.   
  28. 10.chown -R apache:apache wiki  
  29.   
  30. 11.vi /etc/httpd/conf/httpd.conf 添加:  
  31. <Directory "/var/www/html/wiki/images">  
  32. Options -Indexes  
  33. # Ignore .htaccess files  
  34. AllowOverride None  
  35.   
  36. # Serve HTML as plaintext, don't execute SHTML  
  37. AddType text/plain .html .htm .shtml .php  
  38.   
  39. # Don't run arbitrary PHP code.  
  40. php_admin_flag engine off  
  41.   
  42. # If you've other scripting languages, disable them too.  
  43. </Directory>  
  44.   
  45. 11. /etc/httpd/conf/httpd.conf  设置serverName  
  46.   
  47. 12.chmod 775 /var/www/html/wiki/images  
  48.   
  49. 13. vi /etc/php.ini 设置上传文件大小  
  50.   
  51. post_max_size = 128M  
  52. upload_max_filesize = 128M  
  53.   
  54. 14. 打开系统的 80443 端口  
  55.   
  56. 15.service httpd restart  
  57.   
  58. 16. 登陆  http://IP:端口/wiki  
  59.   
  60. 设置:database name:wikidb, database username: mediawiki 等(设置时有前面第4步创建的一致)  
  61. 并选择PHP object caching  
  62.   
  63. 17.下载LocalSettings.php并放到/var/www/html/wiki 目录  
  64.   
  65.   
  66. 18.vi /var/www/html/wiki/LocalSettings.php  
  67.   
  68. $wgEnableUploads = true; # Set this to true  
  69. # 添加如下:  
  70. $wgFileExtensions = array('png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx''xlsx''pptx','ps','odt','ods','odp','odg','exe');  
  71. $wgFileBlacklist = array_diff( $wgFileBlacklist, array ('exe') );    
  72.   
  73. 19.chkconfig httpd on  
  74.   
  75. 20.chkconfig mysqld on  
  76.   
  77. 21.service sendmail restart  
  78.   
  79. 22. chkconfig sendmail on  
  80.   
  81. 23. 安装完毕, 开始你的wiki之旅。  
  82.   
  83.   
  84. 问题1:##linux 下apche无法监听端口解决办法  
  85.   
  86. [root@localhost html]# service httpd start  
  87. Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.termwikidev for ServerName  
  88. (13)Permission denied: make_sock: could not bind to address [::]:81  
  89. (13)Permission denied: make_sock: could not bind to address 0.0.0.0:81  
  90. no listening sockets available, shutting down  
  91. Unable to open logs  
  92.   
  93. 解决办法:  
  94.   
  95. semanage port -l|grep http  
  96. semanage port -a -t http_port_t -p tcp 81  
  97.   
  98.   
  99. 问题2:### CentOS 打开端口 如打开3306端口,操作如下:  
  100.   
  101. /sbin/iptables -I INPUT -p tcp --dport 3036 -j ACCEPT  
  102. 保存我们的操作,命令如下:  
  103. /etc/rc.d/init.d/iptables save  
  104. 查看端口的状态,命令如下:  
  105. /etc/init.d/iptables status 
  106. 问题3: ### 修改DocumentRoot 启动失败
  107. Starting httpd: Syntax error on line 293 of /etc/httpd/conf/httpd.conf:
  108. DocumentRoot must be a directory
  109. chcon -R -h -t httpd_sys_content_t /home/public/www/html/
  110. chcon --reference=/var/www/html/wiki /var/www/html/dokuwiki

猜你喜欢

转载自liming495.iteye.com/blog/2230635