您的位置:首页 > 运维架构 > Apache

ubuntu 安装mysql apache

2010-04-05 17:11 204 查看
sudo apt-get install mysql-server mysql 服务
sudo apt-get install mysql-client mysql 连接
sudo apt-get install libmysqlclient15-dev 安装c 的mysql 开发包
开启mysql服务 sudo /etc/init.d/mysql start

c中mysql编译选项:
gcc -o test test.c -I/usr/include/mysql -L/usr/lib/mysql/*.a -lmysqlclient

开启apache2 服务 sudo /etc/init.d/apache2 start

sudo apt-get install apache2 安装apache2服务器

配置apache 服务器是一定要注意,

安装完Apache后的最重要的一件事就是要知道Web文档根目录在什么地方,对于Ubuntu而言,默认的是/var/www。怎么知道的呢? apache2.conf里并没有DocumentRoot项,httpd.conf又是空的,因此肯定在其他的文件中。经过搜索,发现在 /etc/apache2/sites-enabled/000-default中,

下面是一个关于根目录www 和 ci-bin配置文件
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /home/kanison/www #这里是www根目录
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/kanison/www> #这里也是
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /home/kanison/cgi-bin/ #这里是cgi-bin的目录 是/cgi-bin/ 这个目录映射到/home/kanison/cgi-bin
<Directory "/home/kanison/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

<Directory /home/kanison/cgi-bin>
Options +ExecCGI
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

如果网页上只显示文字不现实图片。很有可能是权限不够。要把权限改为755就可以了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: