linux命令连接域名 linux怎么配置域名-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

linux命令连接域名 linux怎么配置域名

Linux服务器如何绑定域名?

1、首先用putty远程登录服务器。

创新互联公司专注于网站建设,为客户提供网站设计、网站建设、网页设计开发服务,多年建网站服务经验,各类网站都可以开发,品牌网站建设,公司官网,公司展示网站,网站设计,建网站费用,建网站多少钱,价格优惠,收费合理。

2、进入此文件夹。cd /var/www/conf/ 编辑httd.confi文件vi httpd.conf,然后按I,进入编辑模式,修改如下参数:

例如:

VirtualHost *:80

ServerAdmin webmaster@dummy-host.example.com

DocumentRoot /www/docs/dummy-host.example.com

erverName v7o.cn   #如果要修改主域名,修改此处域名并保存即可。

ErrorLog logs/dummy-host.example.com-error_log --记录错误日志文件路径

CustomLog logs/dummy-host.example.com-access_log common--客户访问日志路径

/VirtualHost

如果要添加一个域名,添加ServerAlias字段即可。如添加abc123.com作为网站的第二个域名:

VirtualHost *:80

ServerAdmin webmaster@dummy-host.example.com 

DocumentRoot /www/docs/dummy-host.example.com

ServerName v7o.cn

ServerAlias v7o.cn

ErrorLog logs/dummy-host.example.com-error_log --记录错误日志文件路径

CustomLog logs/dummy-host.example.com-access_log common--客户访问日志路径

/VirtualHost

3、重启服务

# /var/www/bin/apachectl restart

修改完毕保存配置文件,需重启apache才能生效。

linux查看域名命令

在linux下可以通过命令查看域名,那么具体是怎么操作的呢?下面由我为大家整理了linux下查看域名的命令,希望对大家有所帮助。

1.linux查看域名的命令——ifconfig

Linux查看IP地址的命令--ifconfig

ifconfig命令用于查看和更改网络接口的地址和参数

$ifconfig -a

lo0: flags=849 mtu 8232

inet 127.0.0.1 netmask ff000000

hme0: flags=863 mtu 1500

inet 211.101.149.11 netmask ffffff00 broadcast 211.101.149.255

ether 8:0:20:a7:4d:21

系统会显示网络接口的名称,接口的状态(up or down),

接口的IP地址和掩码等信息

2.扩展:如何更改网络接口的IP地址

#ifconfig hme0 down

#ifconfig hme0 211.101.149.233 netmask 255.255.255.0 up

首先,使用down命令参数把网络接口hme0的服务暂时停止,然后再用Linux查看ip的ifconfig命令给

接口分配新的IP地址和掩码,并启动网络接口服务

也可以通过改变文件/etc/hosts中的IP地址的值并重新启动系统来更改机器的IP地址。

/etc/hosts/: 211.101.149.11 sampdt

定义主机名在/etc/hostname.hme0及IP地址。

更改了网卡/增加了网卡,系统不能自动启动该接口服务,这时需要手动创建网口服务:

#ifconfig hme0 plumb

Linux查看ip即可以为接口le0创建网口服务

相应地,用ifconfig带unplumb参数可以停止服务并关闭网络.

netconfig 用来设置IP地址

linux服务器如何绑定域名?

使用一键安装包配置的apache环境,添加网站配置方法如下:

1.命令:cd /alidata/server/httpd/conf/vhosts/

进入网站的配置文件目录

2.命令:vi aa.conf

创建一个新的配置文件

3.按键盘上的字母 “i” ,开始编辑文件,将下面的内容复制过去。

Order allow,deny

Deny from all

DocumentRoot /alidata/www/test

ServerName

ServerAlias test.com

Options Indexes FollowSymLinks

AllowOverride all

Order allow,deny

Allow from all

RewriteEngine On

RewriteRule ^(.*)-htm-(.*)$ $1.php?$2

RewriteRule ^(.*)/simple/([a-z0-9\_]+\.html)$ $1/simple/index.php?$2

ErrorLog "/alidata/log/httpd/test-error.log"

CustomLog "/alidata/log/httpd/test.log" common

对应自己的

ServerName 绑定的网站域名

ServerAlias test.com 绑定的网站别名(您如果有多个域名添加在这里)没有的话,这个可以删除。

DirectoryIndex index.html index.php index.htm 设置默认首页

DocumentRoot /alidata/www/test 和 Directory "/alidata/www/test" 和 DirectoryMatch "/alidata/www/test/都是指定网站的目录,需要一致。

ErrorLog "/alidata/log/httpd/test-error.log" 和 CustomLog "/alidata/log/httpd/test.log" 对应的日志名字也需要自己修改一下,可以区分网站的日志信息。

4.输入命令:/alidata/server/httpd/bin/apachectl restart 重启apache测试。

linux服务器怎么连接远程域名

开启SSH服务。

linux服务器连接远程域名需要开启SSH服务,输入服务器的IP 端口默认为22 4.输入服务器密码进行登录即可连接远程域名。

linux服务器分为访问服务器、文件服务器、数据库服务器、通信服务器和应用服务器等。


当前题目:linux命令连接域名 linux怎么配置域名
文章位置:http://kswsj.cn/article/ddoosgg.html

其他资讯