relax8446

Centos Final Term

Jan 29th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.64 KB | None | 0 0
  1. #先修改好httpd.conf
  2. setenforce 0
  3. service httpd restart
  4.  
  5. #將test.php放置到www目錄下
  6.  
  7. ---------------------------------------------------------------------------
  8.  
  9. #安裝apache 4.4.7
  10. ./configure --prefix=/usr/local/apache --enable-module=so --enable-module=rewrite --with-mpm=worker --enable-cache --enable-file-cache --enable-disk-cache --enable-mem-cache --enable-mime-magic --enable-headers --enable-http --enable-cgi --enable-rewrite --enable-so --with-suexec-gidmin --with-suexec-logfile
  11.  
  12. make
  13.  
  14. make install
  15.  
  16. gedit /usr/local/apache/conf/httpd.conf  
  17.  
  18. #找到 822 AddType application/x-tar .tgz 並在那之上加入
  19. AddType application/x-httpd-php .php .php4 .php3 .phtml
  20. AddType application/x-httpd-php-source .phps
  21.  
  22. #修改連入localhost的port
  23. 219 Listen 8080
  24.  
  25. #修改站台預設目錄
  26. 308 DocumentRoot "/usr/local/apache/htdocs"
  27. -->               /var/www/html
  28. 333 <Directory "/var/www/html">
  29. 362 </Directory>
  30.  
  31.  
  32. 368 UserDir www
  33.     374 <Directory /home/*/www>
  34.     375 #    AllowOverride FileInfo AuthConfig Limit Indexes
  35.     376     Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
  36.     377 #    <Limit GET POST OPTIONS PROPFIND>
  37.     378 #        Order allow,deny
  38.     379 #        Allow from all
  39.     380 #    </Limit>
  40.     381 #    <LimitExcept GET POST OPTIONS PROPFIND>
  41.     382 #        Order deny,allow
  42.     383 #        Deny from all
  43.     384 #    </LimitExcept>
  44.     385 </Directory>
  45.  
  46. 395 DirectoryIndex index.html index.php index.htm index.html.var
  47.  
  48. ---------------------------------------------------------------------------
  49. #為php編譯mcrypt函數
  50. ./configure
  51. make
  52. make install
  53. ---------------------------------------------------------------------------
  54. #php安裝
  55.  
  56. ./configure --prefix=/usr/local/php --with-mysql --with-apxs2=/usr/local/apache/bin/apxs -enable-mbstring=tw  --with-mcrypt --with-zlib-dir=/usr --with-jpeg-dir=/usr
  57.  
  58. #Thank you for using PHP. <-- 一定要出現才能make!!!
  59. make
  60.  
  61. #Build complete <-- 也一定要出現才能intall!!!
  62. make install
  63.  
  64. ----------------------------------------------------------------------------
  65.  
  66. cp php.ini-dist /usr/local/php/lib/php.ini
  67.  
  68.  
  69. #if mysql have problem  讓在PHP4環境中,用phpMyadmin可以連MySQL,如果沒做,使用者無法登入
  70. ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock  
  71.  
  72. /usr/local/apache/bin/apachectl start
  73. /etc/rc.d/init.d/mysqld restart
  74. /usr/bin/mysqladmin -u root password 'ntcbim'
  75.  
  76.  
  77. xoops,apache 4.4.7--> http://localhost:8080/
  78.  
  79. mysql apache 5.3--> http://localhost/
  80.  
  81.  
  82.  
  83. #讓xoops能夠連到mysql資料庫
  84. update user set password=Old_password(“centos”) where user=“root”;
  85. flush privileges;
Add Comment
Please, Sign In to add comment