Score:-2

Apache2 configuration. Different PHP versions

do flag

I have a big problem with MyBB. I uploaded the files fine, gave rights 777.

000-default.conf entry from apache2:

<VirtualHost *:80>
    ServerName 192.168.1.19
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/web/

    <Directory /var/www/web>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost/"
    </FilesMatch>

    ErrorLog ${APACHE_LOG_DIR}/web_error.log
    CustomLog ${APACHE_LOG_DIR}/web_access.log combined
</VirtualHost>

<VirtualHost *:80>
    ServerName 192.168.1.19
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/mybb/

    <Directory /var/www/mybb>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php/php8.1-fpm.sock|fcgi://localhost/"
    </FilesMatch>

    ErrorLog ${APACHE_LOG_DIR}/mybb_error.log
    CustomLog ${APACHE_LOG_DIR}/mybb_access.log combined

    Alias /mybb /var/www/mybb

</VirtualHost>
<VirtualHost *:80>
    ServerName 192.168.1.19
    ServerAdmin webmaster@localhost
    DocumentRoot /usr/share/phpmyadmin/
    
    <Directory /usr/share/phpmyadmin/>
        Options FollowSymLinks
        DirectoryIndex index.php
        AllowOverride All
    </Directory>

    <FilesMatch \.php$>
        SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost/"
    </FilesMatch>

    ErrorLog ${APACHE_LOG_DIR}/phpmyadmin_error.log
    CustomLog ${APACHE_LOG_DIR}/phpmyadmin_access.log combined

    Alias /phpmyadmin /usr/share/phpmyadmin
</VirtualHost>

After typing 192.168.1.19/mybb does not work, same if I type 192.168.1.19/mybb/install or 192.168.1.19/install

MyBB must be using version 8.1. How to fix this? I have no strength left. ChatGPT can't help, I don't know anything about it. I am using Ubuntu 22.04.2 LTS. Apache version is 2.4.56, mariadb version is 10.11.2, php version is 8.1.17 (All packages from the stable release)

/var/ww/web and phpmyadmin must use php 8.2. The site and phpmyadmin work, but mybb does not.

in flag
I would *strongly* suggest replacing `777` with `755` unless you want your websites to be “hacked” by a drive-by script kiddie. Only the web server should be permitted to write files on the server
BuBu avatar
do flag
I know, but it was for testing. I changed it to 755, thanks ! :)
qbi avatar
ph flag
qbi
What is inside `/var/www/mybb/`? Could you paste the output of `ls /var/www/mybb/`?
John Hanley avatar
in flag
You have three `VirtualHost` configurations with the same `ServerName`. Only the first configuration that matches will be used. The other VirtualHosts will be ignored.
Score:0
cn flag

You've configured several vhosts with the same ServerName 192.168.1.19 on the same port (80). Since the last vhos takes precedence over the others phpmyadmin will work. You can make it work by using different ports for each site. For example:

<VirtualHost *:8082>
...
<VirtualHost *:8081>
...
<VirtualHost *:8080>
...
BuBu avatar
do flag
Changed to: https://pastebin.com/5V1eMWfV And mybb still doesn't work. There is an error somewhere in this file, I just don't know where :( After editing the file, I ran the command sudo systemctl restart apache2
user2005651 avatar
cn flag
Please show the error you get. Don’t forget to add the Listen instruction for each port
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.