CentOS-7構築Vue-element-admin
2759 ワード
CentOS-7構築Vue-element-admin
1、プロジェクトのクローン作成
#
cd /var/www/
#
git clone https://github.com/PanJiaChen/vue-element-admin.git
.
├── babel.config.js
├── build
├── jest.config.js
├── jsconfig.json
├── LICENSE
├── mock
├── package.json
├── plopfile.js
├── plop-templates
├── postcss.config.js
├── public
├── README.es.md
├── README.ja.md
├── README.md
├── README.zh-CN.md
├── src
├── tests
└── vue.config.js
2、プロジェクトディレクトリに入る
cd vue-element-admin
3、インストール依存
# npm
npm config set registry https://registry.npm.taobao.org/
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass
#
npm install --unsafe-perm
taobaoソースを一時的に使用してインストールすることもできます#
npm install --registry=https://registry.npm.taobao.org --unsafe-perm
#
sudo npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass --unsafe-perm
4、ローカル開発起動プロジェクト
npm run dev
> [email protected] dev /var/www/vue-element-admin
> vue-cli-service serve
INFO Starting development server...
10% building 2/2 modules 0 activeℹ 「wds」: Project is running at http://localhost:9527/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /var/www/vue-element-admin/public
ℹ 「wds」: 404s will fallback to /index.html
98% after emitting CopyPlugin
DONE Compiled successfully in 69864ms 10:36:10
App running at:
- Local: http://localhost:9527/
- Network: http://172.20.10.6:9527/
Note that the development build is not optimized.
To create a production build, run npm run build.
ファイアウォールの設定
# 【 】
systemctl status firewalld
# 【 】
firewall-cmd --state
#
service firewalld start
#
service firewalld restart
#
service firewalld stop
#
systemctl disable firewalld.service
#
firewall-cmd --query-port=8080/tcp
# 9527
firewall-cmd --permanent --add-port=9527/tcp
firewall-cmd --permanent --add-port=8080-8085/tcp
#
firewall-cmd --permanent --remove-port=8080/tcp
#
firewall-cmd --permanent --list-ports
# ( )
firewall-cmd --reload
SELinuxの設定
# SELinux
setenforce 0
# SELinux
setenforce 1
# SELinux
getenforce
# SELinux
# /etc/selinux/config , SELinux disabled。
vi /etc/selinux/config
SELINUX=disabled
Done
#
cd /var/www/
#
git clone https://github.com/PanJiaChen/vue-element-admin.git
.
├── babel.config.js
├── build
├── jest.config.js
├── jsconfig.json
├── LICENSE
├── mock
├── package.json
├── plopfile.js
├── plop-templates
├── postcss.config.js
├── public
├── README.es.md
├── README.ja.md
├── README.md
├── README.zh-CN.md
├── src
├── tests
└── vue.config.js
cd vue-element-admin
# npm
npm config set registry https://registry.npm.taobao.org/
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass
#
npm install --unsafe-perm
#
npm install --registry=https://registry.npm.taobao.org --unsafe-perm
#
sudo npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass --unsafe-perm
npm run dev
> [email protected] dev /var/www/vue-element-admin
> vue-cli-service serve
INFO Starting development server...
10% building 2/2 modules 0 activeℹ 「wds」: Project is running at http://localhost:9527/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /var/www/vue-element-admin/public
ℹ 「wds」: 404s will fallback to /index.html
98% after emitting CopyPlugin
DONE Compiled successfully in 69864ms 10:36:10
App running at:
- Local: http://localhost:9527/
- Network: http://172.20.10.6:9527/
Note that the development build is not optimized.
To create a production build, run npm run build.
# 【 】
systemctl status firewalld
# 【 】
firewall-cmd --state
#
service firewalld start
#
service firewalld restart
#
service firewalld stop
#
systemctl disable firewalld.service
#
firewall-cmd --query-port=8080/tcp
# 9527
firewall-cmd --permanent --add-port=9527/tcp
firewall-cmd --permanent --add-port=8080-8085/tcp
#
firewall-cmd --permanent --remove-port=8080/tcp
#
firewall-cmd --permanent --list-ports
# ( )
firewall-cmd --reload
# SELinux
setenforce 0
# SELinux
setenforce 1
# SELinux
getenforce
# SELinux
# /etc/selinux/config , SELinux disabled。
vi /etc/selinux/config
SELINUX=disabled