[Ubuntu] LAMP環境架設問題筆記0713

安裝Apache

  • $ sudo apt-get install apache2
安裝MySQL

  • $ sudo apt-get install mysql-server
安裝PHP

  • $ sudo apt-get install php5
安裝MySQL for Apache HTTP Server
  • $ sudo apt-get install libapache2-mod-auth-mysql
  • $ sudo apt-get install php5-mysql
安裝phpmyadmin
  • $ sudo apt-get install phpmyadmin
  • 安裝後於網址列輸入http://你的IP/phpmyadmin
  • 若出現Not found,可以先使用whereis phpmyadmin找出phpmyadmin位置
  • 一般是會有/usr/share/phpmyadmin
  • 接著進到/var/www(/html)內輸入ln -s /usr/share/phpmyadmin
  • 應該就可以了
用ssh登入Ubuntu總是會等個幾秒
  • vi /etc/ssh/sshd_config
  • 在最底下加入 UseDNS no
裝完vsftp後無法在/var/www內新增檔案
  • 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
裝完vsftpd使用sudo service vsftpd restart卻出現 unknown instance
解決 : 先使用 sudo apt-get remove --purge vsftpd
           再使用 sudo apt-get install --purge vsftpd

*****Code Igniter Clean Url on Ubuntu******
  • 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 即可!



留言

這個網誌中的熱門文章

Grafana K6

[翻譯] 介紹現代網路負載平衡與代理伺服器

Linux 事件驅動筆記