服務(wù)器安裝配置
操作系統(tǒng)
下載centos 8鏡像,制作u盤啟動(dòng)盤蚕涤,引導(dǎo)U盤啟動(dòng)但狭。提示 dracut-initqueue timeout
無(wú)法找到安裝媒體但两,分別執(zhí)行dracut:/# cd /dev dracut:/# ls
宏胯;找到安裝媒體的sdb編號(hào)sdbx谜酒,重啟(dracut:/# reboot
)后,安裝界面修改安裝配置文件芦鳍;將vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64.check quiet
修改為vmlinuz initrd=initrd.img inst.stage2=hd:/dev/sdbx(你u盤的編號(hào) 比如sdb1)quiet
,按Ctrl+x即可嚷往。
mysql
安裝
mysql官網(wǎng)找到對(duì)應(yīng)的rpm文件(8.0)地址,下載rpm文件wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
,使用yum -y install *.rpm
安裝柠衅;使用yum -y install mysql-server
安裝服務(wù)器皮仁;
使用
坑1首先關(guān)閉selinux
/etc/selinux/config文件中設(shè)置SELINUX=disabled 然后reboot
坑2安裝完后默認(rèn)沒(méi)有/var/lib/mysql文件夾,需自行'mkdir mysql'創(chuàng)建并賦予權(quán)限
chown -R mysql:mysql /var/lib/mysql
啟動(dòng)服務(wù)
systemctl start mysqld.service
;查看初始密碼:
grep "password" /var/log/mysqld.log
登錄mysql服務(wù)器
mysql -uroot
查看密碼規(guī)則
SHOW VARIABLES LIKE 'validate_password%';
,修改密碼規(guī)則set global validate.number_length=5;set global validate_password.special_char_count=0;
設(shè)置密碼
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
授予權(quán)限
grant all privileges on *.* to 'root'@'192.168.0.1'
,查看權(quán)限·use mysql;select user,authentication_string,host from user;`查看用戶權(quán)限菲宴;開(kāi)啟防火墻
firewall-cmd --zone=public --add-port=3306/tcp --permanent
,firewall-cmd --reload
配置默認(rèn)編碼;修改/etc/my.cnf配置文件贷祈,在[mysqld]下添加編碼配置,
[mysqld]
character_set_server=utf8
init_connect='SET NAMES utf8'
- 重啟mysql;
systemctl restart mysqld
- 創(chuàng)建用戶
CREATE USER 'finley'@'localhost' IDENTIFIED BY 'some_pass';
喝峦,賦予權(quán)限GRANT ALL PRIVILEGES ON *.* TO 'finley'@'localhost' WITH GRANT OPTION;
mysql on ubuntu
create user 'root'@'%' identified by 'Scgd_1234';
grant all privileges on *.* to 'root'@'%';
flush privileges;
PostgreSql
安裝
按照官網(wǎng)鏈接進(jìn)行安裝配置势誊,https://www.postgresql.org/download/linux/redhat/
user&db
create user spuser with password '123456'
create database spdb owner spuser;
grant all privileges on database spdb to spuser;
開(kāi)啟遠(yuǎn)程
修改/var/lib/pgsql/10/data/postgresql.conf(ubuntu中為/etc/postgresql/12/main)文件,取消 listen_addresses 的注釋谣蠢,將參數(shù)值改為“*”粟耻。修改pg_hba.conf文件查近,允許遠(yuǎn)程訪問(wèn),修改ipv4配置
重啟
systemctl restart postgresql-11
- <访Α`挛恕!切記7沽帷=募馈!開(kāi)啟防火墻
firewall-cmd --zone=public --add-port=5432/tcp --permanent
,firewall-cmd --reload
- 安裝pgAdmin4客戶端
postgis
wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum -y install pgdg-redhat-repo-latest.noarch.rpm
postgresql ubuntu
postgresql
sudo apt-get install postgresql
修改/var/lib/pgsql/10/data/postgresql.conf(ubuntu中為/etc/postgresql/12/main)文件茄厘,取消 listen_addresses 的注釋矮冬,將參數(shù)值改為“*”。修改pg_hba.conf文件次哈,允許遠(yuǎn)程訪問(wèn);
安裝postgis
sudo apt-get install postgis
創(chuàng)建空間數(shù)據(jù)庫(kù)及其用戶
create user spuser with password '123456'
create database spdb owner spuser;
grant all privileges on database spdb to spuser;
執(zhí)行postsql腳本
psql -d ltpostgis -f /usr/share/postgresql/12/contrib/postgis-3.0/postgis.sql
psql -d ltpostgis -f /usr/share/postgresql/12/contrib/postgis-3.0/spatial_ref_sys.sql
或者添加擴(kuò)展使數(shù)據(jù)庫(kù)擴(kuò)展為空間數(shù)據(jù)庫(kù)
psql -d yourdatabase -c "CREATE EXTENSION postgis;"
-- if you built with raster support and want to install it --
psql -d yourdatabase -c "CREATE EXTENSION postgis_raster;"
-- if you want to install topology support --
psql -d yourdatabase -c "CREATE EXTENSION postgis_topology;"
-- if you built with sfcgal support and want to install it --
psql -d yourdatabase -c "CREATE EXTENSION postgis_sfcgal;"
-- if you want to install tiger geocoder --
psql -d yourdatabase -c "CREATE EXTENSION fuzzystrmatch"
psql -d yourdatabase -c "CREATE EXTENSION postgis_tiger_geocoder;"
-- if you installed with pcre
-- you should have address standardizer extension as well
psql -d yourdatabase -c "CREATE EXTENSION address_standardizer;"
java
安裝指定版本的開(kāi)源jdksudo apt-get install openjdk-7-jdk
查看當(dāng)前版本java -version
多版本注冊(cè)update-alternatives --config java
卸載官方版本(最新版java14運(yùn)行tomcat要報(bào)錯(cuò))sudo apt-get remove oracle-java14-installer
添加環(huán)境變量vim /etc/profile
#set java environment
export JAVA_HOME=/usr/lib/jvm/jdk-8-openjdk-amd64
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib/dt.jar:${JRE_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin
tomcat
下載tomcat文件胎署,配置srartup.sh和shutdown.sh中java環(huán)境變量,添加tomcat home環(huán)境變量;
#tomcat
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:%{JAVA_HOME}/lib:%{JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
export TOMCAT_HOME=/usr/local/tomcat/apache-tomcat-8.5.55
test localhost:8080