dongtanjian9310 2014-04-09 19:27
浏览 51
已采纳

Apache虚拟主机配置:如何让我的Zend项目和phpMyAdmin一起玩?

In order for me to be able to run a Zend Framework project on my local development machine, I made changes to Apache's \etc\apache2\httpd.conf and the openSUSE system's \etc\hosts files. I set up a test3.local alias for an individual Zend project, and things seem to "work".

Before I started fiddling with things, I could access phpMyAdmin simply by entering http://localhost/phpMyAdmin/ in my browser. And if I take away my changes, that once again works.

Using this answer as a basis, I tried to set up an additional virtual host specifically for phpMyAdmin, hoping to "solve" this problem. But right now if key in the virtual host name, admin.local, that I intend to take me to phpMyAdmin, I get a 403 error like this: 403 error http://willmatheson.com/blogpics/screenshots/phpmyadmin_fail.png

Here is my present httpd.conf:

### Virtual server configuration ############################################
IncludeOptional /etc/apache2/vhosts.d/*.conf

<VirtualHost *:80>
    ServerName test3.local
    DocumentRoot /home/william/public_html/ZendTest3/public

    SetEnv APPLICATION_ENV "development"

    <Directory /home/william/public_html/ZendTest3/public>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

<VirtualHost *:80>
    ServerName admin.local
    DocumentRoot /var/lib/mysql/phpMyAdmin

        # This gives permission to serve the directory
        <Directory /var/lib/mysql/phpMyAdmin>
            DirectoryIndex  index.php
            Options None
            AllowOverride All
            # This allows eveyone to access phpmyadmin, which you may not want
            Order Allow,Deny
            Allow from all
        </Directory>
</VirtualHost>

and hosts:

127.0.0.1       localhost
127.0.0.1       local
127.0.0.1       test3.local
127.0.0.1       admin.local

Ideally I'd like to not have to specify a virtual host for phpMyAdmin at all, because I'm sure to muck it up, and just somehow have the settings to make the Zend project work but to also have phpMyAdmin work like it did before.

  • 写回答

2条回答 默认 最新

  • dongyan2445 2014-04-09 19:27
    关注

    Well, there's a good reason I was getting a 403 - I was digging in the wrong place. My installation of phpMyAdmin was actually in /srv/www/htdocs/phpMyAdmin. Changed that, restarted Apache (sudo systemctl restart apache2.service) and things seem to work.

    If you're interested in how the heck to find files and folders on openSUSE, the following steps worked for me:

    sudo zypper install findutils-locate
    su
    updatedb (go check your e-mail)
    locate phpMyAdmin (like that, not 'phpmyadmin')

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 shape_predictor_68_face_landmarks.dat
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 对于相关问题的求解与代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料
  • ¥15 使用R语言marginaleffects包进行边际效应图绘制