顯示具有 Twminiubuntuserver 標籤的文章。 顯示所有文章
顯示具有 Twminiubuntuserver 標籤的文章。 顯示所有文章

2012年1月4日

Ubuntu Server 改ip位址

1.改 /etc/hosts
2.改/etc/hostname
3.注意/etc/resolv.conf
4.改 /etc/network/interface後 /etc/init.d/networking restart
   參考:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback


auto dsl-provider
iface dsl-provider inet ppp
pre-up /sbin/ifconfig eth0 up # line maintained by pppoeconf
provider dsl-provider


auto eth0
iface eth0 inet manual
# The primary network interface
auto eth1
iface eth1 inet static
        address 192.168.1.1
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 192.168.1.1
        dns-search wuhon.local

5.netstat -tlnup檢查各項服務是否啟動

2011年7月15日

Twminiserver xoops2.5備份與還原(ssh&Rsync)

1. 停apache2&mysql,方法:/etc/init.d/apache2 stop     /etc/init.d/mysql stop
2.將/root/backFTP3內的網頁資料放入/var/www/xoops及/var/xoops_data及/var/xoops_lib,資料庫資料放入/var/lib/mysql/xoops
3. /var/lib/mysql下改資料庫權限擁有者chown -R mysql.mysql xoops
4.清空/var/xoops_data/caches/smarty_compile# rm -rf *
5.修改 /var/www/xoops# vi mainfile.php
      define('XOOPS_URL', 'http://新主機ip位址/xoops');
6.啟動apache2&mysql ,/etc/init.d/apache2 start    /etc/init.d/mysql start
7.注意/var/xoops_data及/var/www/xoops/uplaods ,templates_c權限

TWminiserver內Wordpress移機備份及還原(rsync)

(1) vi /opt/tools/ensshRsync.sh 修改欲備份目錄,及上傳的主機位置
(2)執行/opt/tools/ensshRsync.sh
    1.若失敗先砍 /root/.ssh/id_rsa 及id_rsa.pub
    2.執行ssh-keygen(勿輸入任何密碼,直接都按Enter)
    3.執行cat  ~/.ssh/id_rsa.pub | ssh -l root 上傳主機ip  "cat - >> ~/.ssh/authorized_keys"(會要求輸入上傳主機密碼)
    4.重新執行/opt/tools/ensshRsync.sh
(3)若無修改檔案目錄位置,預設上傳到/root/backFTP3
(4)停/etc/init.d/apache2 stop 及/etc/init.d/mysql stop
(5)將/root/backFTP3的網頁部份放回/var/www/wordpress,資料庫部份放回/var/lib/mysql
(6)重要chown -R mysql.mysql wordpress
(7)啟動 /etc/init.d/apache2 start及/etc/init.d/mysql start,用netstat -tlnup指令查看apache及mysql是否真啟動了
(7)進資料庫http://ip/phpmyadmin
(8)wordpress改換主機後的ip(改wp_blogs,wp_site,wp_options的siteurl(option_id第1)及home(option_id第37)及fileupload_url(option_id第177)及ftp_credentials,wp_sitemata的siteurl,wp_usermeta的source_domain)
(9)將/var/www/wordpress/wp-content 權限先改為777

看來一切美好無出錯,但升級時問題出現了
---------------------------------------------------------------------
(10)**還原完後使用wordpress的升級"立即重新安裝"時遇到問題,顯示打開升級檔,但無法解壓........安裝失敗
       1.vsftp的root權限不通,改vi /etc/ftpusers 將root註解 #root ,
          即可以root身份進ftp
     
       2.修改vsftp設定檔vi /etc/vsftpd.conf,將write_enabe註解拿掉並設為yes
           # Uncomment this to enable any form of FTP write command.
              write_enable=YES




什麼!!還不行,真難搞,若可以就不要再試以下了
----------------------------------------------------------------------
 
       3.啟用rewrite mod,下a2enmod rewrite , 修改/etc/apache2/apache2.conf內加入,可使用固定網址功能
        <Directory /var/www/wordpress>
                  AllowOverride All
        </Directory>


(11)若玩時不小心無法進後台管理時:http://ip/wordrpess/wp-admin可進登入畫面,記得將"其它"模組搬到邊欄

Twminiserver apache2設定

<1>啟用apache2相關模組
       即是將/etc/apache2/mods-available下的檔做softlink到/etc /apache2/mdos-enabaled下,有指令可達成  (1) a2enmod 模組  (2) a2dismod 模組,sites-available相同用法  (1) a2ensite 模組  (2) a2dissite 模組

<2>/etc/apache2/sites-available內的default可改 DocumentRoot /var/www

<3>apache2 模組設定檔在/etc/apache2/mods-enabled以下
    (1) dir.conf為設定讀取網頁檔案的預設順序
       例: <IfModule mod_dir.c>
             DirectoryIndex index.html index.htm index.php index.cgi index.pl index.xhtml
           </IfModule>
    (2) userdir.conf為設定使用者家目錄,並配合chmod -R 755 家目錄
       例:<IfModule mod_userdir.c>
           UserDir public_html
           UserDir disabled root

          <Directory /home/*/public_html>
                AllowOverride FileInfo AuthConfig Limit Indexes
                Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
                <Limit GET POST OPTIONS>
                        Order allow,deny
                        Allow from all
                </Limit>
                <LimitExcept GET POST OPTIONS>
                        Order deny,allow
                        Deny from all
                </LimitExcept>
          </Directory>
         </IfModule>

Twminiserver apache2設定(php5.conf)

利用使用者家目錄裝wordpress時發現,使用者家目錄竟只能正常顯示.htm .html檔案,拒絕.php的程式檔,以前都放/var/www下,沒用使用者家目錄來裝過都沒發現,找到/etc/apache2/mods-enabled下的php5.conf,將檔內以下內容註解即可,就不會出現要開啟或下載視窗了
# <IfModule mod_userdir.c>
#        <Directory /home/*/public_html>
#            php_admin_value engine Off
#        </Directory>
#    </IfModule>
#</IfModule>

2011年3月26日

mini ubuntu server注意PPP連線(eth0)及DHCP(eth1)設定

申請了sonet的adsl非固定制
如圖設定:特別注意eth1對內發dhcp的Default Route設定與ADSL同才行,否則dhcp client端連不出去
並於/etc/rc.local內exit 0 上加入以下二行