日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

阿里云linux服务器初步使用

發布時間:2025/3/15 linux 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 阿里云linux服务器初步使用 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

tomcat 安裝

進到/usr/local/apache執行命令?

wget http://mirrors.cnnic.cn/apache/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz

然后解壓

tar-zxvf apache-tomcat-7.0.57.tar.gz

查看

[root@iZ94l1n0y28Z apache]# ls

apache-tomcat-7.0.57 ?apache-tomcat-7.0.57.tar.gz

[root@iZ94l1n0y28Z apache]# cd apache-tomcat-7.0.57

[root@iZ94l1n0y28Z apache-tomcat-7.0.57]# ls

bin ? lib ? ? ?logs ? ?RELEASE-NOTES ?temp ? ? work

conf ?LICENSE ?NOTICE ?RUNNING.txt ? ?webapps

[root@iZ94l1n0y28Z apache-tomcat-7.0.57]#?

tomcat 啟動 ?

切換到tomcat 的bin路徑下執行?./startup.sh

tomcat 關閉

?./shutdown.sh


查看tomcat運行實時日記

切換到tomcat的logs目錄下

運行?

tail -f catalina.out




jdk安裝

[root@iZ94l1n0y28Z local]# mkdir java

[root@iZ94l1n0y28Z local]# ls

aegis ? bin ?games ? ?java ?lib64 ? ?sbin ? src

apache ?etc ?include ?lib ? libexec ?share

[root@iZ94l1n0y28Z local]# cd java

[root@iZ94l1n0y28Z java]# wget http://download.oracle.com/otn-pub/java/jdk/7u71-b14/jdk-7u71-linux-x64.tar.gz

解壓jdk ?

然后一直不行。

最后直接在window下,下載好文件 然后通過ssh傳到阿里云服務器

下載地址

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

如圖

這次終于解壓成功!

解壓后

配置環境變量

??? ?vi /etc/profile

????export JAVA_HOME = /usr/local/java/jdk1.7xxx
??? export PATH = $JAVA_HOME/bin:$PATH

????export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

注意這里:

export JAVA_HOME=/usr/local/java/jdk1.7.0_71

export PATH=$JAVA_HOME/bin:$PATH

export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar


=號左右2邊不要有空格不然啟動時候報這個錯:-bash: export: `=': not a valid identifier


mysql安裝

mysql安裝花了我比較多的時間

要安裝的有3個

MySQL-server-5.0.96-1.glibc23.x86_64.rpm

MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm

MySQL-client-5.0.96-1.glibc23.x86_64.rpm


一開始執行# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm的時候拋下面的錯誤

?? MySQL conflicts with mysql-5.1.73-3.el6_5.x86_64



[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm

error: Failed dependencies:

? ? ? ? libmysqlclient.so.15()(64bit) is needed by MySQL-server-5.0.96-1.glibc23.x86_64

? ? ? ? libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by MySQL-server-5.0.96-


1.glibc23.x86_64

解決方案:

要裝這個

http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm


安裝server的時候遇到這個問題:

[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm

error: Failed dependencies:

? ? ? ? libmysqlclient.so.15()(64bit) is needed by MySQL-server-5.0.96-1.glibc23.x86_64

? ? ? ? libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by MySQL-server-5.0.96-


1.glibc23.x86_64

? ? ? ? MySQL conflicts with mysql-5.1.73-3.el6_5.x86_64

[root@iZ94l1n0y28Z mysql]# rpm -qa | grep -i libs | grep -i mysql

mysql-libs-5.1.73-3.el6_5.x86_64

[root@iZ94l1n0y28Z mysql]# rpm -e mysql-libs-5.1.73-3.el6_5.x86_64

error: Failed dependencies:

? ? ? ? libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64

? ? ? ? libmysqlclient.so.16()(64bit) is needed by (installed) mysql-5.1.73-3.el6_5.x86_64

? ? ? ? libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-


6.el6_5.x86_64

? ? ? ? libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-


3.el6_5.x86_64

? ? ? ? libmysqlclient_r.so.16()(64bit) is needed by (installed) mysql-5.1.73-3.el6_5.x86_64

? ? ? ? libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-


3.el6_5.x86_64

? ? ? ? mysql-libs is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64

? ? ? ? mysql-libs = 5.1.73-3.el6_5 is needed by (installed) mysql-5.1.73-3.el6_5.x86_64

[root@iZ94l1n0y28Z mysql]# rpm -e mysql-libs

error: Failed dependencies:

? ? ? ? libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64

? ? ? ? libmysqlclient.so.16()(64bit) is needed by (installed) mysql-5.1.73-3.el6_5.x86_64

? ? ? ? libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-


6.el6_5.x86_64

? ? ? ? libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-


3.el6_5.x86_64

? ? ? ? libmysqlclient_r.so.16()(64bit) is needed by (installed) mysql-5.1.73-3.el6_5.x86_64

? ? ? ? libmysqlclient_r.so.16(libmysqlclient_16)(64bit) is needed by (installed) mysql-5.1.73-


3.el6_5.x86_64

? ? ? ? mysql-libs is needed by (installed) postfix-2:2.6.6-6.el6_5.x86_64

? ? ? ? mysql-libs = 5.1.73-3.el6_5 is needed by (installed) mysql-5.1.73-3.el6_5.x86_64

[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm

error: Failed dependencies:

? ? ? ? libmysqlclient.so.15()(64bit) is needed by MySQL-server-5.0.96-1.glibc23.x86_64

? ? ? ? libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by MySQL-server-5.0.96-


1.glibc23.x86_64

? ? ? ? MySQL conflicts with mysql-5.1.73-3.el6_5.x86_64


后來找到方法就是:將系統預裝的刪除掉

[root@iZ94l1n0y28Z mysql]# yum -y remove mysql-libs-5.1.73-3.el6_5.x86_64

刪除掉之后遇到了下面的問題

[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm

error: Failed dependencies:

? ? ? ? libmysqlclient.so.15()(64bit) is needed by MySQL-server-5.0.96-1.glibc23.x86_64

? ? ? ? libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by MySQL-server-5.0.96-


1.glibc23.x86_64

找到解決方法就是如下安裝這個:

[root@iZ94l1n0y28Z mysql]# wget http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-shared-


compat-5.0.96-1.glibc23.x86_64.rpm

[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm

Preparing... ? ? ? ? ? ? ? ?########################################### [100%]

? ?1:MySQL-shared-compat ? ?########################################### [100%]

[root@iZ94l1n0y28Z mysql]# rpm -ivh MySQL-server-5.0.96-1.glibc23.x86_64.rpm

Preparing... ? ? ? ? ? ? ? ?########################################### [100%]

? ?1:MySQL-server ? ? ? ? ? ########################################### [100%]

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !

To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password 'new-password'

/usr/bin/mysqladmin -u root -h iZ94l1n0y28Z password 'new-password'


Alternatively you can run:

/usr/bin/mysql_secure_installation


which will also give you the option of removing the test

databases and anonymous user created by default. ?This is

strongly recommended for production servers.


See the manual for more instructions.


Please report any problems with the /usr/bin/mysqlbug script!


The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

Starting MySQL. SUCCESS!?

[root@iZ94l1n0y28Z mysql


這個時候還不可以用MySQL命令行

還得安裝MySQL-client-5.0.96-1.glibc23.x86_64.rpm


總而言之要將原來系統自帶的干掉

然后按照這個順序分別安裝,至于其他順序我沒試過

MySQL-server-5.0.96-1.glibc23.x86_64.rpm

MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm

MySQL-client-5.0.96-1.glibc23.x86_64.rpm


上面3個資源路徑如下:

路徑分別是

http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-server-5.0.96-1.glibc23.x86_64.rpm

http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-shared-compat-5.0.96-1.glibc23.x86_64.rpm

http://mysql.mirror.kangaroot.net/Downloads/MySQL-5.0/MySQL-client-5.0.96-1.glibc23.x86_64.rpm?


連接數據庫

[root@iZ94l1n0y28Z mysql]# mysql -u root?




設置數據庫編碼


/usr/share/doc/mysql-server-xxxx中的my-large.cnf復制到/etc/my.cnf

先通過vi 打開 my-large.cnf(i進入編輯模式,按esc退出編輯模式,按:wq退出并且保存該文件)


# Example MySQL config file for large systems.

#

# This is for a large system with memory = 512M where the system runs mainly

# MySQL.

#

# You can copy this file to

# /etc/my.cnf to set global options,

# mysql-data-dir/my.cnf to set server-specific options (in this

# installation this directory is /var/lib/mysql) or

# ~/.my.cnf to set user-specific options.

#

# In this file, you can use all long options that a program supports.

# If you want to know which options a program supports, run the program

# with the "--help" option.


# The following options will be passed to all MySQL clients

[client]

#password ? ? ? = your_password

port ? ? ? ? ? ?= 3306

socket ? ? ? ? ?= /var/lib/mysql/mysql.sock


# Here follows entries for some specific programs


# The MySQL server

[mysqld]

port ? ? ? ? ? ?= 3306

socket ? ? ? ? ?= /var/lib/mysql/mysql.sock

skip-locking

key_buffer = 256M

max_allowed_packet = 1M

table_cache = 256

sort_buffer_size = 1M

read_buffer_size = 1M

read_rnd_buffer_size = 4M

myisam_sort_buffer_size = 64M

thread_cache_size = 8

query_cache_size= 16M

# Try number of CPU's*2 for thread_concurrency

thread_concurrency = 8



2. 打開my.cnf,修改編碼(注意:my.cnf是為了設置全局變量?可以將上面的內容復制到這個文件之后再改下面的)

? ? 在[client]下,增加default-character-set=utf8

在[mysqld]下增加default-character-set=utf8 和 init_connect='SET NAMES utf8'

參考文章:

  • 如何遠程連接阿里云主機服務器(Linux系統)

  • Linux下Tomcat的安裝配置

  • 阿里云 安裝 tomcat

  • vi 使用規則

  • mysql-5.1.60-linux-x86_64-glibc23 安裝

  • 在阿里云Linux服務器上安裝MySQL

  • 阿里云centos6.5安裝 mysql

  • 【MySQL案例】mysql-libs-5.1.73-3.el6_5.x86_64 conflicts with file from package Perco

  • libmysqlclient.so.15()(64bit) is needed by perl-DBD-MySQL-3.0007-2.el5.x86_64的解決方法

  • 在阿里云Linux服務器上安裝MySQL

  • MySQL遠程訪問權限,允許遠程連接的開啟

  • Linux 刪除文件夾和文件的命令

  • linux下打開、關閉tomcat,實時查看tomcat運行日志

  • linux下mysql的遠程連接




  • 轉載于:https://my.oschina.net/liangzhenghui/blog/347976

    總結

    以上是生活随笔為你收集整理的阿里云linux服务器初步使用的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。