[Ubuntu] LAMP環境架設問題筆記0713
安裝Apache
- $ sudo apt-get install apache2
- $ sudo apt-get install mysql-server
- $ sudo apt-get install php5
- $ sudo apt-get install libapache2-mod-auth-mysql
- $ sudo apt-get install php5-mysql
- $ sudo apt-get install phpmyadmin
- 安裝後於網址列輸入http://你的IP/phpmyadmin
- 若出現Not found,可以先使用whereis phpmyadmin找出phpmyadmin位置
- 一般是會有/usr/share/phpmyadmin
- 接著進到/var/www(/html)內輸入ln -s /usr/share/phpmyadmin
- 應該就可以了
- vi /etc/ssh/sshd_config
- 在最底下加入 UseDNS no
- sudo chgrp www-data /var/www
- sudo chmod 775 /var/www
- sudo chmod g+s /var/www
- sudo useradd -G www-data 使用者帳號
- --------------------------或是----------------------------------
- There you will find the following line :
- # Uncomment this to enable any form of FTP write command.
- #write_enable=YES
- Uncomment this .. it will look like this.
- # Uncomment this to enable any form of FTP write command.
- write_enable=YES
解決 : 先使用 sudo apt-get remove --purge vsftpd
再使用 sudo apt-get install --purge vsftpd
- sudo a2enmod rewrite
- vi /etc/apache2/apache2.conf
- <Directory /var/www/html/your_site_foler/>
- Options FollowSymLinks
- AllowOverride All
- Require all granted
- </Directory>
- cd /var/www/html/your_site_foler/
- vi .htaccess
- 然後在.htaccess內加入
- RewriteEngine on
- RewriteBase /
- RewriteCond $1 !^(index\.php|images|robots\.txt|$)
- RewriteRule ^(.*)$ index.php/$1 [L,QSA]
- sudo service apache2 restart 即可!
留言
張貼留言