LAMP Linux路由和Libpcap配置

Linux大全评论87 views阅读模式

1、Ubuntu安装:sda会覆盖MBR,选择这个,sda1会导致找不到系统
2、配置路由
在/etc/rc.local 开机时候自动加载
sudo iptables -F  //清除所有规则
sudo iptables -P INPUT ACCEPT
sudo iptables -P FORWARD ACCEPT
sudo iptables -t nat POSTROUTING -o eth1 -j MASQUERADE
具体内容忘记了 eth1 为 wan口网卡

iptables -t nat -L
列出nat表内容
nat filter 等

3、网卡配置
/etc/networking/interfaces
auto eth0
iface eth0 inet static
address
netmask
gateway

xxx

只有wan口网卡需要配置网关
网卡显示 not managed 未托管
配置 /etc/NetworkManager/NetworkManager.conf
将managed 改为 true

先配置路由 再改这个文件

sudo ifup eth0
sudo ifdown eth0

ifconfig

4、配置vsftpd
个人用户使用 仅仅直接安装
sudo apt-get install vsftpd
sudo vim /etc/vsftpd.conf
修改 write-enable=true即可上传文件到个人文件夹

5、配置php apache2
sudo apt-get install php5
sudo apt-get install

老李原创:老李发现ubuntu环境下的apache配置和其他linux环境下的设置是不同,
1>apache 的配置文件路径 /etc/apache2/apache2.conf 2>apache 网站字符编码配置路径 /etc/apache2/conf.d/charset 3>php.ini 路径 /etc/php5/apache2/php.ini
4>mysql配置文件 路径 /etc/mysql/my.cnf 一般不要使用,尤其是新手
5>phpmyadmin配置文件路径 /etc/phpmyadmin/apache.conf
6>默认网站根目录 /var/www
1.更改默认字符集
终端中使用命令
sudo gedit /etc/apache2/conf.d/charset
将其中的
# AddDefaultCharset
的井号去掉,后面字段改成UTF-8(如果您的网站是这样了话)
AddDefaultCharset UTF-8
中间的空格数并不重要,但一定要有。 2.添加支持文件类型(一般不需要),与网站地址(需要) 终端中使用命令
sudo gedit /etc/apache2/apache2.conf
在配置文件最后面加入下面几行:
添加文件类型支持
AddType application/x-httpd-php .php .htm .html
添加首页文件 三个的顺序可以换 前面的访问优先 (当然你也可以加别的 比如default.php)
<IfModule dir_module> DirectoryIndex index.htm index.html index.php </IfModule>
更改服务器地址(改为本机)
ServerName 127.0.0.1
修改apache的根目录DocumentRoot:
sudo gedit /etc/apache2/sites-enabled/000-default
将其中的 DocumentRoot /var/www 改成您想要的目录比如 DocumentRoot /var/www/htdocs/ 以上Apache2就基本配置完成了。重启Apache2服务即可。 下面的是参考,一般不需要改变,除非有特殊需求。
sudo gedit /etc/apache2/ports.conf #修改端口号,修改 Listen 80
再修改site的配置文件
/etc/apache2/sites-available/default
80是端口号
<VirtualHost *:80>
sudo a2enmod rewrite #开启apache 的rewrite功能

6、mysql的安装
sudo apt-get install mysql-server
mysql与php的连接

 为root设置密码: ./bin/mysqladmin -u root password 'passw0rd'

Ubuntu安装配置MySQL  http://www.linuxidc.com/Linux/2013-01/78723.htm

让apache和php支持php :

sudo apt-get install libapache2-mod-auth-mysql

sudo apt-get install php5-mysql

sudo /etc/init.d/apache2 restart(重启apache)

7、libpcap的安装
sudo apt-get install m4
sudo apt-get install flex
sudo apt-get install bison

进入libpcap目录
./configure
make install
n -s /usr/local/lib/libpcap.so.1 /usr/lib/libpcap.so.1

没有mysql.h这个文件,可是我确实安装了mysql了啊。。。。。。。
原来是缺少libmysqlclient-dev,OK安装就是了:sudo apt-get install libmysqlclient-dev

一  下载libpcap 库,文件的格式为x.tar.gz
      http://www.tcpdump.org/release/
二 安装
    1、用
          #tar zxvf x.tat.gz
          命令解压文件到你的当前目录
    2、进入刚才解开的libpcap目录,执行
          #./configure
          命令,生成Makefile文件
    3、输入
          #make install
          将生成的库安装到系统默认目录中。此目录为 /usr/lib ,如果需要修改,可以修改文件Makefile 的 prefix。

makefile:
target = monitor

all: $(target).c
gcc -o $(target) $(target).c -lpcap -lmysqlclient -lpthread -I/usr/include/mysql/

clean:
rm -rf *.o $(target)

新东西:
远程桌面

xrdp
sudo apt-get install xrdp
system tools->preferences->desktop sharing
配置允许远程访问

主要是远程键盘串键的问题非常麻烦
12.04之后的版本 直接改keyboard的快捷键不行
得 sudo apt-get install compizconfig-settings-manager  (安装完 ccsm 启动)
然后找吧 忘记在哪了
window里面的 d 串键

推荐阅读

Ubuntu 13.04 安装 LAMP\Vsftpd\Webmin\phpMyAdmin 服务及设置 http://www.linuxidc.com/Linux/2013-06/86250.htm

CentOS 5.9下编译安装LAMP(Apache 2.2.44+MySQL 5.6.10+PHP 5.4.12) http://www.linuxidc.com/Linux/2013-03/80333p3.htm

企鹅博客
  • 本文由 发表于 2020年9月7日 18:31:21
  • 转载请务必保留本文链接:https://www.qieseo.com/160903.html

发表评论