设为首页 收藏本站
查看: 1822|回复: 0

[经验分享] debian笔记

[复制链接]

尚未签到

发表于 2018-5-15 13:19:36 | 显示全部楼层 |阅读模式
第一节
1.安装ssh
apt-get install ssh openssh-server
网卡设置 /etc/network/interfaces
将allow-hotplug eth0 设置为auto eth0

nano /etc/network/interfaces
auto eth0
allow-hotplug eth0
iface eth0 inet static
        address 192.168.0.1
        netmask 255.255.0.0
        broadcast 192.168.255.255
        gateway   192.168.0.1
重启网络
/etc/init.d/networking restart
编辑/etc/hosts
nano /etc/hosts
127.0.0.1 localhost localdomian localhost
然后输入:
echo ls.ls.com>/etc/hostname
重启系统
shutdown -r now
hostname
hostname -f
ssh成功
----------------------------
更新系统
编辑/etc/apt/sources.list文件,命令如下:
nano /etc/apt/sources.lis
加入如下源:
deb http://ftp2.de.debian.org/debian/etch main
deb-src http://ftp2.de.debian.org/debian/ etch main
然后输入:
apt-get update
更新apt封装数据库,命令如下:
apt-get upgrade
然后会安装更新的数据包

第二节DNS服务器的设置
1.补充内容
linux连接linux
ssh root@192.168.0.2(对方IP)
exit登出

2.配置bind的dns服务器
DNS三种类型1.缓存域名服务器2.主域名服务器3.辅域名服务器
apt-get install bind9
apt-get isntall dnsutils
apt-get isntall bind9-host

/etc/bind/named.conf

首先 DNS指向自己
nano /etc/resolv.conf
search ls.ls.com
nameserver 192.168.0.2
修改/etc/bind/named.conf.options文件中提供对域名
正向解析和IP的反向解析
named.conf.options是named.conf的包含文件

nano /etc/bind/named.conf.options
配置内容如下:
options {
        directory "/var/cache/bind";
        allow-query { any; };
};
zone "example.com" {
     type master;
     file "foxitsoftware.com.db";
};

配置正向解析文件/var/cache/bind/ds.ls
cp /etc/bind/db.local /var/cache/bind/db.ls

//var/cache/bind#
vim example.com.db
$TTL    604800
@       IN SOA  @ ns01.example.com. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
       NS  @
$ORIGIN example.com.
example.com      IN      MX      10      mail.example.com.
www        IN         A       192.168.2.222
mail       IN         A       192.168.2.222
rt         IN         A       192.168.2.222


重新启动
/usr/sbin/rndc reload
重新配置
/uer/sbin/rndc reconfig
语法检查:

named-checkconf named.conf.option
测试
host nslookup
host ls.ls.com
host IP 反向解析


第三节配置apache
安装
apt-get install apache2
安装elinks
apt-get install elinks
apache2.conf配置文件
对配置文件进行分割,利于管理
/etc/apache2/sites-available/default
端口ports.conf
conf.d编码
nano /etc/apache2/sites-available/default
DocumentRoot /var/www/lssite
注销这行 RedirectMatch ^/$ /apache2-default/
Errorlog /var/log/apache2/ls_error.log

删除默认的网页在apache2-default
mkdir /var/www/lssite
cd lssite
echo "it work">index.html
ls -l查看权限 index.html 能否访问
重启
/etc/init.d/apache2 restart

cd /home
cd ls
mkdir public_html
cd public_html
nano index.html
cd /
a2enmod userdir
/etc/init.d/apache2 force-reload





mail:/etc/apache2/sites-available# ls
default  default-ssl  vhost_rt  wwwmydebian

NameVirtualHost *
<VirtualHost *>
ServerAdmin webmaster@localhost
ServerName www.mysite.com
DocumentRoot /var/www/mysite
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mysite/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/mysite_error.log
LogLevel warn
CustomLog /var/log/apache2/mysite_access.log combined
ServerSignature On
</VirtualHost>


mail:/etc/apache2/sites-available# vim vhost_rt
<VirtualHost *:80>
ServerAdmin root@localhost
DocumentRoot /var/www/example_com/rt/htdocs
ServerName www.rt.com
<Directory /var/www/example_com/rt/htdocs>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/www_rt_com_error.log
LogLevel warn
CustomLog /var/log/apache2/www_rt_com_access.log combined
ServerSignature On
</VirtualHost>















mysql安装
1.数据库目录
/var/lib/mysql/
2.配置目录
/etc/mysql
3.命令文件
/usr/share/mysql(mysql.server命令及配置文件)
4.启动脚本
/etc/init.d/mysql(启动脚本文件mysql的目录)
修改mysql密码
1.命令
#mysqladmin -u root password 'new-password'
mysqladmin -u用户名 -p旧密码 password新密码
2.
mysqladmin -u root password 123

create database+库名;
例如创建一个名字为ls的库
create database ls;
use ls;
create table sl;
create table sl(name varchar(20),sex varchar(20),birth date,
);
describe sl;
insert into sl values('ls','man','1978-8-8');
select * from sl;

--------------------
samba
apt-get install samba
/etc/samba/smb.conf
配置共享目录
[global]
log file=/var/log/samba/log.%m
[WOW]
comment=tem file
path=/WOW
read only=no
public=yes
重启/etc/init.d/samba restart

创建用户
touch /etc/samba/smbpasswd
smbpasswd -a 用户名(ls)





Debian 参考手册
http://www.linuxforum.net/forum/ubbthreads.php

http://docs.huihoo.com/debian/debian-study.html#id2861730
http://www.cmuch.com/attachments/month_0603/reference.zh-cn.html
http://www.cmuch.com/article.asp?id=51


在debian下安装local的问题要解决这个问题,其实很简单,只要执行下面几条命令,一切都会OK:

debian:~# apt-get install locales
debian:~# dpkg-reconfigure locales
debian:~# locale

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-460608-1-1.html 上篇帖子: Debian软件包信息查询 下篇帖子: debian system securing
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表