前要提示:

 如果你要安装asp.net 请参考: http://www.cnblogs.com/xiaoruilin/p/7867823.html

 

背景:

  CentOS7 

  Mono (Mono JIT compiler version 5.4.0.201 ) 安装(http://www.mono-project.com/download/#download-lin-centos

1、下载jexus  在 Linux DotNET大本营: https://linuxdot.net/index.aspx?p=3#_d  重要下载 处找到最新版本

cd /usr
wget https://linuxdot.net/down/jexus-5.8.2-x64.tar.gz

2、解压并启动,这个版本不用安装

tar -zxvf jexus-5.8.2-x64.tar.gz
cd jexus #解压的目录名就是jexus
sudo /usr/jexus/jws start #启动
停止:sudo /usr/jexus/jws stop 
重启:sudo /usr/jexus/jws restart 
重启指定网站:sudo /usr/jexus/jws restart siteName 
停止指定网站:sudo /usr/jexus/jws stop siteName

3、设置Jexus服务开机自启动

  按 i 键进入编辑模式添一句  

    /usr/jexus/jws start

  按ESC退出编辑模式,输入 :wq保存文件

vi /etc/rc.local
i
"/usr/jexus/jws start"
:wq
reboot #重启服务器
cat /usr/jexus/log/jws.log #查看启动情况

下面方法也可以:

[root@loclhost ~]# vi /etc/init.d/jws

 

#!/bin/bash

#chkconfig: 2345 80 05

#description:jws

#

. /etc/rc.d/init.d/functions

 

case "$1" in

start)

echo "Jexus Start.."

/usr/jexus/jws start

;;

stop)

echo "Jexus Stop.."

/usr/jexus/jws stop

;;

restart)

echo "Jexus Restart"

/usr/jexus/jws restart

;;

status)

/usr/jexus/jws status

;;

*)

exit 1

;;

esac

 

exit $RETVAL


[root@loclhost  ~]# chmod 766 /etc/init.d/jws
[root@loclhost  ~]# chkconfig --add /etc/init.d/jws

 

4、网站测试及修改端口

sudo vi /usr/jexus/siteconf/default #查询 root的目录及端口
#port=80
#root=/ /var/www/default
i #进入插入模式将80 改为 7777
:wq #保存并退出
cd /var
mkdir www
cd www
mkdir default
cd default/
vi index.html
"
<html>
  <head>
  </head>
  <body>
    Hello jexus index 7777
  </body>
</html>
"
:wq
sudo /usr/jexus/jws restart 

http://xxx:7777/

Hello jexus index 7777

可以了

 

相关文章:

  • 2021-06-30
  • 2021-07-13
  • 2021-08-04
  • 2021-11-17
  • 2021-12-20
  • 2018-10-16
  • 2021-10-01
  • 2021-05-23
猜你喜欢
  • 2021-11-07
  • 2021-09-21
  • 2021-10-10
  • 2021-10-08
  • 2021-11-25
  • 2022-12-23
  • 2021-06-17
相关资源
相似解决方案