ubuntu 安装mysql apache

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就可以了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值