OS + Linux CentOS 7 / CentOS-7.0-1406-x86_64-Everything.iso
s
CentOSdownload
http://mirrors.163.com/centos/7.0.1406/isos/x86_64/CentOS-7.0-1406-x86_64-Everything.iso
http://isoredirect.centos.org/centos/7/isos/x86_64/
http://isoredirect.centos.org/centos/6/isos/x86_64/
http://mirrors.163.com/centos/6.0/isos/x86_64/
http://mirrors.jiangnan.edu.cn/centos/6.0/isos/x86_64/
http://mirror.neu.edu.cn/centos/6.0/isos/x86_64/
http://centos.ustc.edu.cn/centos/6.0/isos/x86_64/
http://mirrors.ta139.com/centos/6.0/isos/x86_64/
http://vault.centos.org/
2.1/ | 19-Aug-2009 01:36 | - | |
3.1/ | 31-Jul-2005 16:05 | - | |
3.3/ | 17-Mar-2005 11:17 | - | |
3.4/ | 01-Mar-2005 01:38 | - | |
3.5/ | 28-Jul-2005 16:14 | - | |
3.6/ | 04-Apr-2006 16:59 | - | |
3.7/ | 06-May-2006 01:20 | - | |
3.8/ | 20-Apr-2012 10:55 | - | |
3.9/ | 20-Apr-2012 10:49 | - | |
4.0/ | 23-Jun-2005 12:09 | - | |
15-Sep-2005 23:40 | - | ||
4.1/ | 19-Oct-2005 12:09 | - | |
4.2/ | 04-Nov-2006 12:35 | - | |
23-Oct-2005 11:17 | - | ||
4.3/ | 27-Aug-2006 12:04 | - | |
4.4/ | 01-Nov-2006 19:32 | - | |
4.5/ | 08-Dec-2007 09:23 | - | |
4.6/ | 18-Sep-2008 14:35 | - | |
4.7/ | 14-Feb-2010 12:50 | - | |
4.8/ | 20-Apr-2012 21:13 | - | |
4.9/ | 20-Apr-2012 21:13 | - | |
5.0/ | 11-Apr-2007 17:53 | - | |
27-Nov-2007 10:38 | - | ||
5.2/ | 18-Jun-2008 23:34 | - | |
5.3/ | 14-Feb-2010 02:30 | - | |
5.4/ | 25-Jun-2010 14:38 | - | |
5.5/ | 14-May-2010 21:04 | - | |
5.6/ | 12-Aug-2011 19:51 | - | |
5.7/ | 13-Sep-2011 00:58 | - | |
5.8/ | 27-Feb-2012 19:57 | - | |
5.9/ | 12-Jan-2013 01:11 | - | |
5.10/ | 07-Oct-2014 13:31 | - | |
5.11/ | 30-Sep-2014 09:49 | - | |
6.0/ | 19-Dec-2011 18:49 | - | |
6.1/ | 08-Dec-2011 10:04 | - | |
6.2/ | 19-Dec-2011 13:25 | - | |
6.3/ | 09-Jul-2012 20:10 | - | |
6.4/ | 20-Jun-2013 14:50 | - | |
6.5/ | 21-Dec-2013 14:05 | - | |
6.6/ | 31-Jul-2015 15:17 | - | |
6.7/ | 21-Jan-2016 13:22 | - | |
6.8/ | 24-May-2016 18:38 | - | |
07-Apr-2015 14:36 | - | ||
13-Nov-2015 13:01 | - |
CentOSYUMupdate
1.yum倉庫升級,RHEL可以採用CentOS的軟體倉庫,在/etc/yum.repos.d目錄新增CentOS-Base.repo檔案。
[base]
name=CentOS-5-Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
baseurl=http://ftp.sjtu.edu.cn/centos/5/os/$basearch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#releasedupdates
[update]
name=CentOS-5-Updates
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
baseurl=http://ftp.sjtu.edu.cn/centos/5/updates/$basearch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#packagesused/producedinthebuildbutnotreleased
[addons]
name=CentOS-5-Addons
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons
baseurl=http://ftp.sjtu.edu.cn/centos/5/addons/$basearch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#additionalpackagesthatmaybeuseful
[extras]
name=CentOS-5-Extras
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras
baseurl=http://ftp.sjtu.edu.cn/centos/5/extras/$basearch/
gpgcheck=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#additionalpackagesthatextendfunctionalityofexistingpackages
[centosplus]
name=CentOS-5-Plus
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
baseurl=http://ftp.sjtu.edu.cn/centos/5/centosplus/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#contrib-packagesbyCentosUsers
[contrib]
name=CentOS-5-Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
baseurl=http://ftp.sjtu.edu.cn/centos/5/contrib/$basearch/
gpgcheck=0
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5
#vidag.repo
[dag]
name=DagRPMRepositoryforRHEL5
baseurl=http://ftp.riken.jp/Linux/dag/redhat/el5/en/$basearch/dag/
enabled=1
gpgcheck=0
gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt
CentOS新增永久靜態路由
http://blog.chinaunix.net/u1/42991/showart_2090676.html
在使用雙網絡卡,同時使用2個閘道器的時候就需要加一條靜態路由了。當然還有很多時候會需要加路由。
一:使用route命令新增
使用route命令新增的路由,機器重啟或者網絡卡重啟後路由就失效了,方法:
//新增到主機的路由
#routeadd–host192.168.1.11deveth0
#routeadd–host192.168.1.12gw192.168.1.1
//新增到網路的路由
#routeadd–net192.168.1.11netmask255.255.255.0eth0
#routeadd–net192.168.1.11netmask255.255.255.0gw192.168.1.1
#routeadd–net192.168.1.0/24eth1
//新增預設閘道器
#routeadddefaultgw192.168.2.1
//刪除路由
#routedel–host192.168.1.11deveth0
二:在linux下設定永久路由的方法:
1.在/etc/rc.local裡新增
方法:
routeadd-net192.168.3.0/24deveth0
routeadd-net192.168.2.0/24gw192.168.2.254
2.在/etc/sysconfig/network裡新增到末尾
方法:GATEWAY=gw-ip或者GATEWAY=gw-dev
3./etc/sysconfig/static-routes:
anynet192.168.3.0/24gw192.168.3.254
anynet10.250.228.128netmask255.255.255.192gw10.250.228.129
如果在rc.local中新增路由會造成NFS無法自動掛載問題,所以使用static-routes的方法是最好的。無論重啟系統和servicenetworkrestart都會生效
以下是蚊子解決NFS問題的描述:
按照linux啟動的順序,rc.local裡面的內容是在linux所有服務都啟動完畢,最後才被執行的,也就是說,這裡面的內容是在netfs之後才被執行的,那也就是說在netfs啟動的時候,伺服器上的靜態路由是沒有被新增的,所以netfs掛載不能成功。
static-routes檔案又是什麼呢,這個是network指令碼執行時呼叫的一個檔案,這個檔案的放置在/etc/sysconfig目錄下,在network指令碼中的位置是:
#Addnoninterface-specificstatic-routes.
if[-f/etc/sysconfig/static-routes];then
grep"^any"/etc/sysconfig/static-routes|whilereadignoreargs;do
/sbin/routeadd-$args
done
fi
從這段指令碼可以看到,這個就是新增靜態路由的方法,static-routes的寫法是
anynet192.168.0.0/16gw閘道器ip
這樣的話,在啟動network指令碼的時候路由就自動新增上了,又因為network是在netfs前面啟動的,自然在掛載nfs的時候就正常了。
這樣看來,如果需要新增靜態路由,使用static-routes檔案要比使用rc.local好,而且當改變了網路配置,需要重啟network指令碼的時候,相應的靜態路由是可以自動新增上的,但這時如果使用rc.local的話,在重啟network服務的時候,原本新增好的靜態路由就消失了。
http://www.udomaindelivery.com/et2009daily/actionpage/
Apache/2.2.3(CentOS)Serveratwww.udomaindelivery.comPort80
centOs5.3安裝apache+tomcat+php+mysql
http://elf8848.iteye.com/blog/448998
--------------下載須要的檔案--------------------------
以下檔案都下載到了/mnt/目錄下.
1下載JDK,到sun的網站上下載jdk-6u16-linux-i586-rpm.bin,到本地Windows機器上,再用FileZilla上傳到伺服器.
2遠端ssh登入linux,#cd/mnt,下載apache:命令如下:wget-chttp://apache.etoak.com/httpd/httpd-2.2.13.tar.gz
3下載mysql-5.0.84.tar.gz方法同上
4下載apache-tomcat-6.0.20.tar.gz方法同上
5下載php-5.3.0.tar.gz
6下載apr-1.3.3.tar.gz與apr-util-1.3.4.tar.gz從http://apr.apache.org/下載
-----------------開始安裝JDK-----------------
#cpjdk-6u16-linux-i586-rpm.bin/usr/local,拷貝到/usr/local下
#cd/usr/local
#chmod+xjdk-6u16-linux-i586-rpm.bin新增可執行許可權
#./jdk-6u16-linux-i586-rpm.bin就執行了
出現相關的安裝協議,按"q",略過,再安"y",就開始安裝jdk了.過一會按回車.就完成了
預設安裝在/usr/java目錄下,我們做一個軟連線
#ln-s/usr/java/jdk1.6.0_16//usr/local/java
設定環境變數
#vi/etc/profile
安"i"進入編輯模式
在最後加入:
JAVA_HOME=/usr/java/jdk1.6.0_16
CLASSPATH=/usr/java/jdk1.6.0_16/lib/dt.jar:/usr/java/jdk1.6.0_16/lib/tools.jar
PATH=/usr/java/jdk1.6.0_16/bin:$PATH
exportPATHJAVA_HOMECLASSPATH
Shift+:wq!儲存退出
使生效:#source/etc/profile
#java-version檢視版本資訊,說明安裝成功
---------------安裝mysql(原始碼三步安裝)-------------------------
#cd/mnt/
#tarzxvfmysql-5.0.84.tar.gz
#cdmysql-5.0.84
#./configure--prefix=/usr/local/mysql--with-charset=utf8--with-extra-charset=all--enable-thread-safe-client--enable-local-infile--with-low-memory
說明:安裝到=/usr/local/mysql下,語言用utf8
通到錯誤:configure:error:noacceptableCcompilerfoundin$PATH
說明沒安gcc,現在安:
檢視系統是否安裝了gcc和安裝程式的版本號:
gcc-v
c++-v
g++-v
如果沒有就用以下命令安裝
#yuminstallgcc
#yuminstallgcc-c++
#yuminstallgcc-gfortran
再次:
#./configure--prefix=/usr/local/mysql--with-charset=utf8--with-extra-charset=all--enable-thread-safe-client--enable-local-infile--with-low-memory
還是出錯:
checkingfortermcapfunctionslibrary...configure:error:Nocurses/termcaplibraryfound
說明要安ncurses
#yuminstallncurses-devel
提示安裝N個軟體,略,按"y",完成
再次:
#./configure--prefix=/usr/local/mysql--with-charset=utf8--with-extra-charset=all--enable-thread-safe-client--enable-local-infile--with-low-memory
出現:ThankyouforchoosingMySQL!說明mysql安裝的第一步成功
------------
#make&&makeinstall
如果你的gcc-c++是在configure後安裝的,再重新configure一下,可以會以下錯誤:
error:redeclarationofC++built-intype‘bool’
慢長的等待,安好了
-------------
建使用者,使用者組
#groupaddmysql
#adduser-gmysqlmysql
#cpsupport-files/my-medium.cnf/etc/my.cnf
本例中my-medium.cnf檔案在這裡:/mnt/mysql-5.0.84/support-files/my-medium.cnf
我們的mysql安裝在/usr/local/mysql/裡
#chown-Rmysql.mysql/usr/local/mysql/
#/usr/local/mysql/bin/mysql_install_db--user=mysql
#chown-Rroot.root/usr/local/mysql/
#chown-Rmysql.mysql/usr/local/mysql/var/
啟動一下,後面加一個&表示後臺執行
#/usr/local/mysql/bin/mysqld_safe--user=mysql&
#netstat-ant看到3306端品號,說明已啟動
加入到開機啟動中
#cpsupport-files/mysql.server/etc/rc.d/init.d/mysqld
給許可權
#chmod755/etc/rc.d/init.d/mysqld
把mysqld服務加入啟動中
#chkconfig--addmysqld
執行級別
#chkconfig--level345mysqldon
設定密碼
#/usr/local/mysql/bin/mysqladmin-urootpassword"****"
進入mysql
#/usr/local/mysql/bin/mysql-uroot-p
輸入密碼,就進入了
看有哪些庫:showdatabases;
退出:quit
配置mysql庫檔案的搜尋路徑:
#echo"/usr/local/mysql/lib/mysql/">>/etc.ld.so.conf
#ldconfig生效
#ldconfig-v輸出一下
新增mysql到系統的環境變數中
#echo"exportPATH=$PATH:/usr/local/mysql/bin">>/etc/profile
#source/etc/profile生效
完成
------------------------安裝apr-----------------
#cd/mnt
#tarzxvfapr-1.3.3.tar.gz
#cdapr-1.3.3
#./configure--prefix=/usr/local/apr
#make
#makeinstall
#tarzxvfapr-util-1.3.4.tar.gz
#cdapr-util-1.3.4
#./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/apr
#make&&makeinstall
---------------------------安裝apache-------------
#cd/mnt
#tarzxvfhttpd-2.2.13.tar.gz
#cdhttpd-2.2.13
#./configure--prefix=/usr/local/apache--enable-so--enable-rewrite--enable-proxy--enable-proxy-ajp--enable-proxy-balancer--with-apr=/usr/local/apr--with-apr-util=/usr/local/apr-util
開了rewrite,proxy模組
#make&&makeinstall
啟動apache
#/usr/local/apache/bin/apachectlstart
看一下埠,有沒有80埠
#netstat-ant
也可以看一下程序
#ps-ef|grephttpd
下一步,把apache加入開機自啟動
#cp/usr/local/apache/bin/apachectl/etc/rc.d/init.d/httpd
#vi/etc/rc.d/init.d/httpd
在第二行新加兩行,內容如下:
#chkconfig:23451090
#description:Activates/DeactiatesApacheWebServer
儲存退出.
#chkconfig--addhttpd加入自啟動
#chkconfig--level345httpdon設定執行級別
重啟apache:
#/usr/local/apache/bin/apachectlrestart
----------------------安裝tomcat---------------------
只以解壓就可以了,不用安裝
#cpapache-tomcat-6.0.20.tar.gz/usr/local/
#cd/usr/local/
#tarzxvfapache-tomcat-6.0.20.tar.gz
#cdapache-tomcat-6.0.20
#rm-frapache-tomcat-6.0.20.tar.gz
#mvapache-tomcat-6.0.20/tomcat
#vi/usr/local/tomcat/bin/catalina.sh
在最後加入一行JAVA_HOME=/usr/java/jdk1.6.0_16
儲存退出
啟動:
#/usr/local/tomcat/bin/startup.sh
加入開機自啟動
#vi/etc/rc.d/rc.local
在最後加入
exportJDK_HOME=/usr/java/jdk1.6.0_16
exportJAVA_HOME=/usr/java/jdk1.6.0_16
/usr/local/tomcat/bin/startup.sh
-----------------安裝php----------------------
#cd/mnt/
#tarzxvfphp-5.3.0.tar.gz
#cdphp-5.3.0
#./configure--prefix=/usr/local/php--with-apxs2=/usr/local/apache/bin/apxs--with-mysql=/usr/local/mysql/--with-config-file-path=/usr/local/php
出錯:
configure:error:xml2-confignotfound.Pleasecheckyourlibxml2installation.
要安裝下面兩個東東:
#yuminstalllibxml2
#yuminstalllibxml2-devel
再次./configure..............成功
#make&&makeinstall
#cpphp.ini-dist/usr/local/php/php.ini
增加apache對php的支援,修改apache的配置檔案
#vi/usr/local/apache/conf/httpd.conf
搜尋如下內容,
LoadModulephp5_modulemodules/libphp5.so
插入一行:
AddTypeapplication/x-httpd-php.php
再搜尋
DirectoryIndex
原來是:
<IfModuledir_module>
DirectoryIndexindex.html</IfModule>
改為:
<IfModuledir_module>
DirectoryIndexindex.htmlindex.phpindex.jsp
</IfModule>
儲存退出
在/usr/local/apache/htdocs/下建一個php檔案,準備測試.
測試前要先重啟apache:
#servicehttpdrestart
出錯:
httpd:Syntaxerroronline53of/usr/local/apache/conf/httpd.conf:Cannotload/usr/local/apache/modules/libphp5.sointoserver:/usr/local/apache/modules/libphp5.so:cannotrestoresegmentprotafterreloc:Permissiondenied
解決出現Permissiondenied的辦法
http://hi.baidu.com/software_one/blog/item/657974f20d3ef5a5a40f52d7.html
許可權不夠:
chmod777*.bin
在linux上安裝有些東西時會出現Permissiondenied的情況:以下就是解決它的辦法之一
編輯/etc/selinux/config,找到這段:
#ThisfilecontrolsthestateofSELinuxonthesystem.
#SELINUX=cantakeoneofthesethreevalues:
#enforcing-SELinuxsecuritypolicyisenforced.
#permissive-SELinuxprintswarningsinsteadofenforcing.
#disabled-SELinuxisfullydisabled.
SELINUX=enforcing
把SELINUX=enforcing註釋掉:#SELINUX=enforcing,然後新加一行為:
SELINUX=disabled
儲存,關閉。
......
編輯/etc/sysconfig/selinux,找到:
#ThisfilecontrolsthestateofSELinuxonthesystem.
#SELINUX=cantakeoneofthesethreevalues:
#enforcing-SELinuxsecuritypolicyisenforced.
#permissive-SELinuxprintswarningsinsteadofenforcing.
#disabled-SELinuxisfullydisabled.
SELINUX=enforcing
如果SELINUX已經是SELINUX=disabled,那麼就不用改了,否則就把SELINUX=enforcing註釋掉,新加一行:
SELINUX=disabled
儲存,退出。
如果你碰到其他類似提示:
cannotrestoresegmentprotafterreloc:Permissiondenied
哪應該是SELinux的問題,可以考慮把它關閉。
-------------------------------------------------------------------------------------
在你保證SElinux被disable後.還執行下
chcon-ttexrel_shlib_t
如:chcon-ttexrel_shlib_t/路徑/路徑/名字.so(這個檔案視具體執行檔案.)
以上兩步.已經解決了很多server的問題了.
原因:是Linux有一個SELinux保護模式引起的。
解決辦法:
1關閉SELINUX的方法:
vi/etc/selinux/config將SELINUX=enforcing改成SELINUX=disabled需要重啟
這個方法可能會對伺服器帶來風險。
2不關閉SELINUX的方法:
#setenforce0
#chcon-c-v-R-usystem_u-robject_r-ttextrel_shlib_t/usr/local/apache/modules/libphp5.so
#servicehttpdrestart
#setenforce1
ok,php頁面可以訪問了
------------------------------------------------------
apache,預設會把資料夾下的檔案結構顯示出來,我們禁止這個功能
#vi/usr/local/apache/conf/httpd.conf
找到:
OptionsIndexesFollowSymLinks
一行,並在前面加#,註釋他
----------------------------------------------------
------------------整合apache與tomcat---------------------------------
#vi/usr/local/apache/conf/httpd.conf
在最後加入下面兩行:
ProxyPass/ajp://127.0.0.1:8009/注意最後有一個"/",千萬不能少
ProxyPassReverse/ajp://127.0.0.1:8009/注意最後有一個"/",千萬不能少
瀏覽器的位址列中輸入IP,就可看見tomcat的預設頁面了.
-------------------配置php程式--------------------------------------
我們在/usr/local/apache/htdocs/下建一個phpbbs資料夾,裡面放php程式.
#chmod-R777phpbbs/
#vi/usr/local/apache/conf/httpd.conf
註釋掉前面剛加的:
#ProxyPass/ajp://127.0.0.1:8009/注意最後有一個"/",千萬不能少
#ProxyPassReverse/ajp://127.0.0.1:8009/
開啟(去掉前面的#)下面的子配置檔案:
#Virtualhosts
Includeconf/extra/httpd-vhosts.conf
儲存退出
#vi/usr/local/apache/conf/extra/httpd-vhosts.conf
修改為如下:
<VirtualHost*:80>
DocumentRoot"/usr/local/apache/htdocs/phpbbs"
ServerNamebbs.tgjia.com
ErrorLog"/usr/local/apache/logs/phpbbs-error_log"
CustomLog"/usr/local/apache/logs/phpbbs-access_log"common
</VirtualHost>
重啟apache.
php程式要安裝在"/usr/local/apache/htdocs/phpbbs"下面.略.....
用bbs.tgjia.com域名就可能訪問了
---------------------配置JSP程式-------------------------------------
我們在/usr/local/apache/htdocs/下建一個jspbbs資料夾,裡面放jsp程式.
#chmod-R777jspbbs/
#vi/usr/local/apache/conf/extra/httpd-vhosts.conf
加入如下虛擬主機的配置
<VirtualHost*:80>
DocumentRoot"/usr/local/apache/htdocs/jspbbs"
ServerNamewww.aaa.com
ErrorLog"/usr/local/apache/logs/jspbbs-error_log"
CustomLog"/usr/local/apache/logs/jspbbs-access_log"common
ProxyPass/ajp://127.0.0.1:8009/
ProxyPassReverse/ajp://127.0.0.1:8009/注意最後有一個"/",千萬不能少
</VirtualHost>
儲存退出,重啟apache
-------------------------------php程式換目錄----------------------------------------------------
在/下建立php,並開相應許可權
#mkdir/php
#chmod-R777/php
#vi/usr/local/apache/conf/extra/httpd-vhosts.conf
修改為如下:
<VirtualHost*:80>
DocumentRoot"/php"修改為新位置
ServerNamebbs.tgjia.com
ErrorLog"/php/logs/phpbbs-error_log"
CustomLog"/phplogs/phpbbs-access_log"common
</VirtualHost>
建立/php/logs,並拷貝以下兩個原有的日誌檔案過來.
/usr/local/apache/logs/jspbbs-error_log
/usr/local/apache/logs/jspbbs-access_log"
#vihttpd.conf
<Directory/>
OptionsFollowSymLinks
AllowOverrideNone
Orderdeny,allow
Allowfromall這樣就可以訪問"/usr/local/apache/htdocs/"以外的位置了
</Directory>
重啟apache.
centos5.2下手動安裝JDK6
http://exceljava.iteye.com/blog/305908
centos5.2自帶的了jdk,但還是1.4的版本,太老掉牙了,tomcat6都沒發跑起來。顯然沒法滿足我們的要求。我們先檢視一下,如下所示:
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=%5Broot%40localhost%20soft%5D%23%20java%20-version%0Ajava%20version%20%E2%80%9C1.4.2%E2%80%B3%0Agij%20(GNU%20libgcj)%20version%204.1.2%2020071124%20(Red%20Hat%204.1.2-42)"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[[email protected]]#java-version
javaversion“1.4.2″
gij(GNUlibgcj)version4.1.220071124(RedHat4.1.2-42)
[[email protected]]#java-version
javaversion“1.4.2″
gij(GNUlibgcj)version4.1.220071124(RedHat4.1.2-42)
注意,根據我在5.2下安裝的情況,似乎不解除安裝自帶的1.4,設定jdk6的安裝無法生效。為了避免這種情況,我們首先還是解除安裝掉其自帶的1.4版本的jdk。
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=%5Broot%40localhost%20soft%5D%23%20rpm%20-qa%20%7C%20grep%20jdk%0A%5Broot%40localhost%20soft%5D%23%20rpm%20-qa%20%7C%20grep%20gcj%0Alibgcj-4.1.2-42.el5%0Ajava-1.4.2-gcj-compat-1.4.2.0-40jpp.115"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[[email protected]]#rpm-qa|grepjdk
[[email protected]]#rpm-qa|grepgcj
libgcj-4.1.2-42.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
[[email protected]]#rpm-qa|grepjdk
[[email protected]]#rpm-qa|grepgcj
libgcj-4.1.2-42.el5
java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
上面先確認jdk的具體版本號,然後
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=root%40localhost%20jdk1.6.0_11%5D%23%20yum%20-y%20remove%20java-1.4.2-gcj-compat-1.4.2.0-40jpp.115%0ASetting%20up%20Remove%20Process%0AResolving%20Dependencies%E2%80%A6%E2%80%A6%E2%80%A6..(%E5%BC%80%E5%A7%8B%E5%8D%B8%E8%BD%BD)%0ARemoved%3A%20java-1.4.2-gcj-compat.i386%200%3A1.4.2.0-40jpp.115%0ADependency%20Removed%3A%20antlr.i386%200%3A2.7.6-4jpp.2%20bsf.i386%200%3A2.3.0-11jpp.1%20bsh.i386%200%3A1.3.0-9jpp.1%20gjdoc.i386%200%3A0.7.7-12.el5%20hsqldb.i386%201%3A1.8.0.9-1jpp.2%20openoffice.org-calc.i386%0A1%3A2.3.0-6.5.el5%20openoffice.org-core.i386%201%3A2.3.0-6.5.el5%20openoffice.org-draw.i386%201%3A2.3.0-6.5.el5%20openoffice.org-graphicfilter.i386%201%3A2.3.0-6.5.el5%20openoffice.org-impress.i386%0A1%3A2.3.0-6.5.el5%20openoffice.org-langpack-zh_CN.i386%201%3A2.3.0-6.5.el5%20openoffice.org-langpack-zh_TW.i386%201%3A2.3.0-6.5.el5%20openoffice.org-math.i386%201%3A2.3.0-6.5.el5%20openoffice.org-%0Awriter.i386%201%3A2.3.0-6.5.el5%20openoffice.org-xsltfilter.i386%201%3A2.3.0-6.5.el5%20tomcat5-jsp-2.0-api.i386%200%3A5.5.23-0jpp.7.el5%20tomcat5-servlet-2.4-api.i386%200%3A5.5.23-0jpp.7.el5%20xalan-%0Aj2.i386%200%3A2.7.0-6jpp.1%20xerces-j2.i386%200%3A2.7.1-7jpp.2%20xml-commons-apis.i386%200%3A1.3.02-0.b2.7jpp.10%20xml-commons-resolver.i386%200%3A1.1-1jpp.12%0AComplete!(%E5%8D%B8%E8%BD%BD%E5%AE%8C%E6%88%90)"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[email protected]_11]#yum-yremovejava-1.4.2-gcj-compat-1.4.2.0-40jpp.115
SettingupRemoveProcess
ResolvingDependencies………..(開始解除安裝)
Removed:java-1.4.2-gcj-compat.i3860:1.4.2.0-40jpp.115
DependencyRemoved:antlr.i3860:2.7.6-4jpp.2bsf.i3860:2.3.0-11jpp.1bsh.i3860:1.3.0-9jpp.1gjdoc.i3860:0.7.7-12.el5hsqldb.i3861:1.8.0.9-1jpp.2openoffice.org-calc.i386
1:2.3.0-6.5.el5openoffice.org-core.i3861:2.3.0-6.5.el5openoffice.org-draw.i3861:2.3.0-6.5.el5openoffice.org-graphicfilter.i3861:2.3.0-6.5.el5openoffice.org-impress.i386
1:2.3.0-6.5.el5openoffice.org-langpack-zh_CN.i3861:2.3.0-6.5.el5openoffice.org-langpack-zh_TW.i3861:2.3.0-6.5.el5openoffice.org-math.i3861:2.3.0-6.5.el5openoffice.org-
writer.i3861:2.3.0-6.5.el5openoffice.org-xsltfilter.i3861:2.3.0-6.5.el5tomcat5-jsp-2.0-api.i3860:5.5.23-0jpp.7.el5tomcat5-servlet-2.4-api.i3860:5.5.23-0jpp.7.el5xalan-
j2.i3860:2.7.0-6jpp.1xerces-j2.i3860:2.7.1-7jpp.2xml-commons-apis.i3860:1.3.02-0.b2.7jpp.10xml-commons-resolver.i3860:1.1-1jpp.12
Complete!(解除安裝完成)
[email protected]_11]#yum-yremovejava-1.4.2-gcj-compat-1.4.2.0-40jpp.115
SettingupRemoveProcess
ResolvingDependencies………..(開始解除安裝)
Removed:java-1.4.2-gcj-compat.i3860:1.4.2.0-40jpp.115
DependencyRemoved:antlr.i3860:2.7.6-4jpp.2bsf.i3860:2.3.0-11jpp.1bsh.i3860:1.3.0-9jpp.1gjdoc.i3860:0.7.7-12.el5hsqldb.i3861:1.8.0.9-1jpp.2openoffice.org-calc.i386
1:2.3.0-6.5.el5openoffice.org-core.i3861:2.3.0-6.5.el5openoffice.org-draw.i3861:2.3.0-6.5.el5openoffice.org-graphicfilter.i3861:2.3.0-6.5.el5openoffice.org-impress.i386
1:2.3.0-6.5.el5openoffice.org-langpack-zh_CN.i3861:2.3.0-6.5.el5openoffice.org-langpack-zh_TW.i3861:2.3.0-6.5.el5openoffice.org-math.i3861:2.3.0-6.5.el5openoffice.org-
writer.i3861:2.3.0-6.5.el5openoffice.org-xsltfilter.i3861:2.3.0-6.5.el5tomcat5-jsp-2.0-api.i3860:5.5.23-0jpp.7.el5tomcat5-servlet-2.4-api.i3860:5.5.23-0jpp.7.el5xalan-
j2.i3860:2.7.0-6jpp.1xerces-j2.i3860:2.7.1-7jpp.2xml-commons-apis.i3860:1.3.02-0.b2.7jpp.10xml-commons-resolver.i3860:1.1-1jpp.12
Complete!(解除安裝完成)
下面開始手動安裝,我用的安裝包是jdk-6u11-linux-i586.bin,沒有使用redhat平臺通用的rpm包。
首先,通過ssh將jdk-6u11-linux-i586.bin上傳到/home/xjj/soft下。然後,要給jdk-6u11-linux-i586.bin
分配許可權,具體的這裡要給它可執行的許可權,輸入:chmod+xjdk-6u11-linux-i586.bin,這裡引數x即使執行許可權。
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=%5Broot%40localhost%20soft%5D%23%20chmod%20%2Bx%20jdk-6u11-linux-i586.bin"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[[email protected]]#chmod+xjdk-6u11-linux-i586.bin
[[email protected]]#chmod+xjdk-6u11-linux-i586.bin
然後解壓:./jdk-6u11-linux-i586.bin,
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=%5Broot%40localhost%20soft%5D%23%20.%2Fjdk-6u11-linux-i586.bin"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[[email protected]]#./jdk-6u11-linux-i586.bin
[[email protected]]#./jdk-6u11-linux-i586.bin
執行之後會有一堆agreement什麼的,一路more下去。接著有個確認安裝的,輸入yes,然後回車。開始解壓。一直到
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=Java(TM)%20SE%20Development%20Kit%206%20successfully%20installed.%0A.........%0APress%20Enter%20to%20continue.....%0ADone."quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
Java(TM)SEDevelopmentKit6successfullyinstalled.
.........
PressEntertocontinue.....
Done.
Java(TM)SEDevelopmentKit6successfullyinstalled.
.........
PressEntertocontinue.....
Done.
看看解壓後的檔案先
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=%5Broot%40localhost%20soft%5D%23%20ls%0Ajdk1.6.0_11%20jdk-6u11-linux-i586.bin%0A%5Broot%40localhost%20soft%5D%23%20cd%20jdk1.6.0_11%0A%5Broot%40localhost%20jdk1.6.0_11%5D%23%20ls%0Abin%20db%20include%20lib%20man%20README_ja.html%20register.html%20register_zh_CN.html%20src.zip%0ACOPYRIGHT%20demo%20jre%20LICENSE%20README.html%20README_zh_CN.html%20register_ja.html%20sample%20THIRDPARTYLICENSEREADME.txt"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[[email protected]]#ls
jdk1.6.0_11jdk-6u11-linux-i586.bin
[[email protected]]#cdjdk1.6.0_11
[[email protected]_11]#ls
bindbincludelibmanREADME_ja.htmlregister.htmlregister_zh_CN.htmlsrc.zip
COPYRIGHTdemojreLICENSEREADME.htmlREADME_zh_CN.htmlregister_ja.htmlsampleTHIRDPARTYLICENSEREADME.txt
[[email protected]]#ls
jdk1.6.0_11jdk-6u11-linux-i586.bin
[[email protected]]#cdjdk1.6.0_11
[[email protected]_11]#ls
bindbincludelibmanREADME_ja.htmlregister.htmlregister_zh_CN.htmlsrc.zip
COPYRIGHTdemojreLICENSEREADME.htmlREADME_zh_CN.htmlregister_ja.htmlsampleTHIRDPARTYLICENSEREADME.txt
哈哈,看到我們熟悉的東西了吧完成解壓。一般都將安裝檔案放在usr/local下,當然你不這樣也拿你沒辦法。所以,先執行拷貝:
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=%5Broot%40localhost%20soft%5D%23%20mv%20jdk1.6.0_11%20%2Fusr%2Flocal%0A%5Broot%40localhost%20xjj%5D%23%20cd%20..%2F..%0A%5Broot%40localhost%20%2F%5D%23%20ls%0Abin%20dev%20home%20lost%2Bfound%20misc%20net%20proc%20sbin%20srv%20tmp%20var%0Aboot%20etc%20lib%20media%20mnt%20opt%20root%20selinux%20sys%20usr%0A%5Broot%40localhost%20%2F%5D%23%20cd%20%2Fusr%2Flocal%0A%5Broot%40localhost%20local%5D%23%20ls%0Abin%20etc%20games%20include%20jdk1.6.0_11%20lib%20libexec%20sbin%20share%20src"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[[email protected]]#mvjdk1.6.0_11/usr/local
[[email protected]]#cd../..
[[email protected]/]#ls
bindevhomelost+foundmiscnetprocsbinsrvtmpvar
bootetclibmediamntoptrootselinuxsysusr
[[email protected]/]#cd/usr/local
[[email protected]]#ls
binetcgamesincludejdk1.6.0_11liblibexecsbinsharesrc
[[email protected]]#mvjdk1.6.0_11/usr/local
[[email protected]]#cd../..
[[email protected]/]#ls
bindevhomelost+foundmiscnetprocsbinsrvtmpvar
bootetclibmediamntoptrootselinuxsysusr
[[email protected]/]#cd/usr/local
[[email protected]]#ls
binetcgamesincludejdk1.6.0_11liblibexecsbinsharesrc
好了,jdk已經成功搬運到了/usr/local下,然後就是最後一步,設定環境變量了。這裡有兩中設定,一種是通過export設定臨時生效,重啟
之後設定會丟失,一種是將設定寫入/etc/profile檔案中,可以一直生效。所以,最好的設定當然是寫入檔案中了。先執行下面命令:
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=%5Broot%40localhost%20jdk1.6.0_11%5D%23%20vi%20%2Fetc%2Fprofile%20"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[[email protected]_11]#vi/etc/profile
[[email protected]_11]#vi/etc/profile
開啟profile檔案後輸入i進入insert模式,在檔案中新增如下內容。
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=export%20JAVA_HOME%3D%2Fusr%2Flocal%2Fjdk1.6.0_11%0Aexport%20PATH%3D%24PATH%3A%24JAVA_HOME%2Fbin%0Aexport%20CLASSPATH%3D.%3A%24JAVA_HOME%2Flib%2Ftools.jar%3A%24JAVA_HOME%2Flib%2Frt.jar"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
exportJAVA_HOME=/usr/local/jdk1.6.0_11
exportPATH=$PATH:$JAVA_HOME/bin
exportCLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/rt.jar
exportJAVA_HOME=/usr/local/jdk1.6.0_11
exportPATH=$PATH:$JAVA_HOME/bin
exportCLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/rt.jar
然後esc,輸入:x,儲存退出。然後需要設定讓更改生效:
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=%5Broot%40localhost%20local%5D%23%20source%20%2Fetc%2Fprofile"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[[email protected]]#source/etc/profile
[[email protected]]#source/etc/profile
當然,如果你喜歡重啟的話,你reboot也可以。
好了看看現在的jdk版本吧:
Java程式碼<embedtype="application/x-shockwave-flash"width="14"height="15"src="http://exceljava.iteye.com/javascripts/syntaxhighlighter/clipboard_new.swf"flashvars="clipboard=%5Broot%40localhost%20local%5D%23%20java%20-version%0Ajava%20version%20%E2%80%9C1.6.0_11%E2%80%B3%0AJava(TM)%20SE%20Runtime%20Environment%20(build%201.6.0_11-b03)%0AJava%20HotSpot(TM)%20Client%20VM%20(build%2011.0-b16%2C%20mixed%20mode%2C%20sharing)"quality="high"allowscriptaccess="always"pluginspage="http://www.macromedia.com/go/getflashplayer"></embed>
[[email protected]]#java-version
javaversion“1.6.0_11″
Java(TM)SERuntimeEnvironment(build1.6.0_11-b03)
JavaHotSpot(TM)ClientVM(build11.0-b16,mixedmode,sharing)
[[email protected]]#java-version
javaversion“1.6.0_11″
Java(TM)SERuntimeEnvironment(build1.6.0_11-b03)
JavaHotSpot(TM)ClientVM(build11.0-b16,mixedmode,sharing)
大功告成!www.exceljava.com
評論
符號連結也即軟連線
1樓zijin11172009-01-03引用
應該不用解除安裝嗎,
找到系統預設的java,好象是 /bin/java
重新做符號連結就行了。
ln-s/usr/local/jdk1.6.0_11/bin/java/bin/java
就可以了。
<!--BEGIN#content--><!--BEGIN#primary.hfeed--><!--BEGIN.hentry-->
linux硬連結與軟連線的區別
http://www.myredhat.com.cn/linux-hard-link-and-soft-link-the-difference-between/
WrittenbyRedhaton2009年09月8日—LeaveaComment<!--END.entry-meta.entry-header-->
<!--BEGIN.entry-content.article-->
雖然linuxln建立連結文中提到了在linux下如何建立硬連結和軟連線,但是仍然有很多童鞋不知道硬連結和軟連線的區別.
所以呢,今天Redhat有必要詳細介紹下linux下硬連線與軟連線的區別.
首先我們需要了解linux下硬連結以及軟連線的基本概念.
硬連結:新建的檔案是已經存在的檔案的一個別名,當原檔案刪除時,新建的檔案仍然可以使用.
軟連線:也成符號連結,新建的檔案以“路徑”的形式來表示另一個檔案,和Windows的快捷方式十分相似.
下面詳細介紹一下硬連結和軟連線之間的區別.
1.硬連結和原來的檔案沒有什麼區別,而且共享一個inode號(檔案在檔案系統上的唯一標識);而軟連結不共享inode,也可以說是個特殊的inode,所以和原來的inode有區別。
2.若原檔案刪除了,則該軟連線則不可以訪問,而硬連線則是可以的。
3.由於符號連結的特性,導致其可以跨越磁碟分割槽,但硬連結不具備這個特性.
另外在轉載一下網上的介紹.
硬連結(hardlink)
UNIX檔案系統提供了一種將不同檔案連結至同一個檔案的機制,我們稱這種機制為連結。它可以使得單個程式對同一檔案使用不同的名字。這樣的好處是檔案系統只存在一個檔案的副本。系統簡單地通過在目錄中建立一個新的登記項來實現這種連線。該登記項具有一個新的檔名和要連線檔案的inode號(inode與原檔案相同)。不論一個檔案有多少硬連結,在磁碟上只有一個描述它的inode,只要該檔案的連結數不為0,該檔案就保持存在。硬連結不能對目錄建立硬連結!
硬連線是直接建立在節點表上的(inode),建立硬連線指向一個檔案的時候,會更新節點表上面的計數值。舉個例子,一個檔案被連線了兩次(硬連線),這個檔案的計數值是3,而無論通過3個檔名中的任何一個訪問,效果都是完全一樣的,但是如果刪除其中任意一個,都只是把計數值減1,不會刪除實際的內容的,(任何存在的檔案本身就算是一個硬連線)只有計數值變成0也就是沒有任何硬連線指向的時候才會真實的刪除內容。
軟連結(symboliclink)
我們把符號連結稱為軟連結,它是指向另一個檔案的特殊檔案,這種檔案的資料部分僅包含它所要連結檔案的路徑名。軟連結是為了克服硬連結的不足而引入的,軟連結不直接使用inode號作為檔案指標,而是使用檔案路徑名作為指標(軟連結:檔名+資料部分-->目標檔案的路徑名)。軟體有自己的inode,並在磁碟上有一小片空間存放路徑名。因此,軟連結能夠跨檔案系統,也可以和目錄連結!其二,軟連結可以對一個不存在的檔名進行連結,但直到這個名字對應的檔案被建立後,才能開啟其連結。
http://linux.51yip.com/search/lsblk
lsblk列出所有的塊裝置,而且還能顯示他們之間的依賴關係
引數:
-a,--all顯示所有裝置
-b,--bytes以bytes方式顯示裝置大小
-d,--nodeps不顯示slaves或holders
-D,--discardprintdiscardcapabilities
-e,--exclude<list>排除裝置(default:RAMdisks)
-f,--fs顯示檔案系統資訊
-h,--help顯示幫助資訊
-i,--asciiuseasciicharactersonly
-m,--perms顯示許可權資訊
-l,--list使用列表格式顯示
-n,--noheadings不顯示標題
-o,--output<list>輸出列
-P,--pairs使用key="value"格式顯示
-r,--raw使用原始格式顯示
-t,--topology顯示拓撲結構資訊
[email protected]:~# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 232.9G 0 disk ├─sda1 8:1 0 46.6G 0 part / ├─sda2 8:2 0 1K 0 part ├─sda5 8:5 0 190M 0 part /boot ├─sda6 8:6 0 3.7G 0 part [SWAP] ├─sda7 8:7 0 93.1G 0 part /data └─sda8 8:8 0 89.2G 0 part /personal sr0 11:0 1 1024M 0 rom
案例二:CentOS 7.3.1611 64位 ping不通域名地址問題解決 / 動態分配地址解決方法
centos下問題:connect:network is unreachable
http://www.cnblogs.com/valu/p/6515991.html
CentOS 7.0 網絡卡配置及重新命名教程
http://www.linuxidc.com/Linux/2017-05/143287.htm
Java程式碼- 第一步,查詢本地路由表資訊
- [root@SCTS-PC-DEV rc.d]# route
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- 10.19.252.84 10.24.41.254 255.255.255.255 UGH 100 0 0 enp3s0
- 10.24.41.0 0.0.0.0 255.255.255.0 U 100 0 0 enp3s0
- 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
- 第二步,新增預設閘道器,就好了。
- [root@SCTS-PC-DEV rc.d]# route add default gw 10.24.41.254
- [root@SCTS-PC-DEV rc.d]# route
- Kernel IP routing table
- Destination Gateway Genmask Flags Metric Ref Use Iface
- default gateway 0.0.0.0 UG 0 0 0 enp3s0
- 10.19.252.84 gateway 255.255.255.255 UGH 100 0 0 enp3s0
- 10.24.41.0 0.0.0.0 255.255.255.0 U 100 0 0 enp3s0
- 192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0
- 第三步,能ping通外部IP地址和域名地址了
- [root@SCTS-PC-DEV rc.d]# ping 192.168.118.201
- PING 192.168.118.201 (192.168.118.201) 56(84) bytes of data.
- 64 bytes from 192.168.118.201: icmp_seq=1 ttl=55 time=1.55 ms
- 64 bytes from 192.168.118.201: icmp_seq=2 ttl=55 time=1.56 ms
- 64 bytes from 192.168.118.201: icmp_seq=3 ttl=55 time=1.68 ms
配置永久生效方法如下:
Shell程式碼- 檢視已配置的預設閘道器地址
- [[email protected] ~]# more /etc/sysconfig/network-scripts/ifcfg-enp3s0 | grep GATEWAY
- GATEWAY0=10.24.41.254
- [[email protected] ~]# nmcli connection show enp3s0 | grep GATEWAY
- IP4.GATEWAY: 10.24.41.254
- IP6.GATEWAY:
CentOS 6/7網絡卡重啟命令回顧:
CentOS 6 以下用:service network restart
CentOS 7 以上用:systemctl restart network.service
CentOS 7檢視網絡卡:systemctl status network.service 或 service network status
CentOS 7.3.1611網絡卡基本配置解析:
Shell程式碼- [[email protected] ~]# more /etc/sysconfig/network-scripts/ifcfg-enp3s0
- TYPE=Ethernet
- BOOTPROTO=dhcp
- DEFROUTE=yes
- IPV4_FAILURE_FATAL=yes
- IPV6INIT=no
- IPV6_AUTOCONF=yes
- IPV6_DEFROUTE=yes
- IPV6_FAILURE_FATAL=no
- IPV6_ADDR_GEN_MODE=stable-privacy