Fedora 18安裝配置

來源:互聯網
上載者:User

Fedora 18安裝配置 1 添加教育網源 (1) Shell代碼  cd /etc/yum.repos.d/   (2) Shell代碼  sudo vi sjtu.repo   Shell代碼  [Fedora-ftp.sjtu.edu.cn]  name=Fedora 18 –  x86_64  baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/18/Fedora/x86_64/os/  enabled=1  gpgcheck=0  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora  [Everything-ftp.sjtu.edu.cn]  name=Everything 18 – x86_64  baseurl=http://ftp.sjtu.edu.cn/fedora/linux/releases/18/Everything/x86_64/os/  enabled=1  gpgcheck=0  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora  [updates-ftp.sjtu.edu.cn]  name=Fedora updates  baseurl=http://ftp.sjtu.edu.cn/fedora/linux/updates/18/x86_64/  enabled=1  gpgcheck=0   注意,本次安裝的是fedora 18 x86_64系統,如果是32位系統則將x86_64換位i386即可,全換。 如果所在使用者尚未成為sudoers則請進入root使用者 Shell代碼  su  vi /etc/sudoers   在root使用者下面添加一行  Shell代碼  yourusername   ALL=(ALL)       ALL   然後退出,重啟一下,這樣常用使用者名稱就擁有了超級使用者的所有許可權了。  2 測試添加的源 安裝vim 由於本人習慣使用vim,所以下面就安裝vim編輯器。 Shell代碼  yum install vim   等待安裝完成即可。  3 jdk環境 本例中直接使用openjdk。  4 下載並解壓eclipse 解壓後添加運行許可權 Shell代碼  chmod +x eclipse    5 安裝Tomcat 下載並解壓Tomcat 6.0.36.tar.gz 運行tomcat檔案夾中的startup.sh http://localhost:8080 看到歡迎介面則一切正常。  配置Tomcat自動啟動 Shell代碼  sudo vim /etc/init.d/Tomcat6    Shell代碼  #!/bin/bash  # chkconfig: 2345 10 90  # description: Auto-starts tomcat6  # /etc/init.d/tomcat6  # Tomcat auto-start  # Source function library.  #. /etc/init.d/functions  # source networking configuration.  #. /etc/sysconfig/network    #set -x    #service network restart    RETVAL=0  #export JRE_HOME=/usr/lib64/jvm/jre  export CATALINA_HOME_6=/home/bupt/programFiles/apache-tomcat-6.0.36  export CATALINA_BASE_6=/home/bupt/programFiles/apache-tomcat-6.0.36  start()  {                if [ -f $CATALINA_HOME_6/bin/startup.sh ];            then              echo $"Starting Tomcat6"                  $CATALINA_HOME_6/bin/startup.sh              RETVAL=$?              echo " OK"              return $RETVAL          fi  }  stop()  {          if [ -f $CATALINA_HOME_6/bin/shutdown.sh ];            then              echo $"Stopping Tomcat"                  $CATALINA_HOME_6/bin/shutdown.sh              RETVAL=$?              sleep 1              ps -fwwu tomcat | grep apache-tomcat|grep -v grep | grep -v PID | awk '{print $2}'|xargs kill -9              echo " OK"              # [ $RETVAL -eq 0 ] && rm -f /var/lock/...              return $RETVAL          fi  }    case "$1" in  start)          start          ;;  stop)           stop          ;;                                                   restart)           echo $"Restaring Tomcat6"           $0 stop           sleep 1           $0 start           ;;  *)          echo $"Usage: $0 {start|stop|restart}"          exit 1          ;;  esac  exit $RETVAL    儲存退出。 Shell代碼  sudo chmod a+x Tomcat6  sudo chkconfig --add Tomcat6  sudo chkconfig --list Tomcat6   如果出現: Shell代碼  注意:該輸出結果只顯示 SysV 服務,並不包含原生 systemd 服務。SysV 配置資料可能被原生 systemd 配置覆蓋。  Tomcat6         0:關    1:關    2:開    3:開    4:開    5:開    6:關   則一切正常。 Shell代碼  chkconfig Tomcat6 on    重啟之後Tomcat自動啟動。  6 安裝MySQL Shell代碼  yum  install mysql mysql-server    安裝成功之後設定自動啟動。 Shell代碼  systemctl enable mysqld.service  systemctl start mysqld.service    建立密碼並登陸mysql Shell代碼  mysqladmin -u root password myownsecrectpass  mysql -u root –p    建立使用者 Shell代碼  mysql> CREATE USER 'webuser'@'%' IDENTIFIED BY 'password123';   授權 Shell代碼  mysql> GRANT ALL ON *.* TO 'webuser'@'%';   更新 Shell代碼  mysql> FLUSH PRIVILEGES;    建立使用者已經可以從遠程登陸,下面開放root使用者遠程登陸許可權。 Shell代碼  GRANT ALL PRIVILEGES ON *.* TO root@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;    FLUSH PRIVILEGES;    如果不能訪問則應該關閉防火牆或添加允許資訊。 Shell代碼  sudo vim /etc/sysconfig/iptables   添加一行 Shell代碼  -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT    如想完全關閉防火牆和SELinux Shell代碼  sudo systemctl stop firewalld.service  sudo systemctl disable firewalld.service     Shell代碼     vi /etc/sysconfig/selinux    # This file controls the state of SELinux on the system.  # SELINUX= can take one of these three values:  #        enforcing - SELinux security policy is enforced.  #        permissive - SELinux prints warnings instead of enforcing.  #        disabled - SELinux is fully disabled.  SELINUX = disabled       #修改  # SELINUXTYPE= type of policy in use. Possible values are:  #        targeted - Only targeted network daemons are protected.  #        strict - Full SELinux protection.  SELINUXTYPE=targeted    7安裝VNCServer 伺服器遠程是必需的工具 安裝 Shell代碼  yum install vnc-server tigervnc-server   啟動 Shell代碼  vncserver   查看 Shell代碼  vncserver –list   關閉 Shell代碼  vncserver –kill :1    設定自啟動 Shell代碼  sudo cp /lib/systemd/system/vncserver@.service /etc/systemd /system/vncserver@:1.service    添加 Shell代碼  User=username   儲存後退出並運行 Shell代碼  sudo systemctl --system daemon-reload  sudo systemctl enable vncserver@:1.service   sudo systemctl start vncserver@:1.service  vncpasswd   

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.