Jump to content

Moving from CentOS to Ubuntu - Not working


Recommended Posts

Hi all,

Due to the EOL of CentOS, I am moving to a Ubuntu install.  There may be some differences between the two platforms causing my issues.  I use Plesk as a control panel for the server.  I migrated one of my forums but it doesn't seem to work on the new system (after the data was migrated).  Does anyone here have experience moving a site like this?  Here's the error I get when accessing the site.  I am using PHP 8.3.1.2.  Also see the details from the ips4.php tool.  It also doesn't look like my previous (CentOS) server had a constants.php file in the root.  Help is appreciated.  Thank you!

Could contain: Page, Text, File

 

Could contain: Page, Text, File

Link to comment
Share on other sites

Just now, Mike Gholson said:

I am using PHP 8.3.1.2

Keep in mind this is not support. It's only either PHP 8.0 and 8.1. We recommend 8.1.

1 minute ago, Mike Gholson said:

Could contain: Page, Text, File

You would need to ensure that your directories are properly writable by your server and are owned by the correct user/group.

The following directories need to be writable:

  • applications
  • datastore
  • plugins
  • uploads and all sub-folders of uploads

 

Additionally, you will want to check your conf_global.php for database access and ensure that your database connections are correct. As well as that your database user has full access.

Link to comment
Share on other sites

Just now, Jim M said:

Keep in mind this is not support. It's only either PHP 8.0 and 8.1. We recommend 8.1.

You would need to ensure that your directories are properly writable by your server and are owned by the correct user/group.

The following directories need to be writable:

  • applications
  • datastore
  • plugins
  • uploads and all sub-folders of uploads

 

Additionally, you will want to check your conf_global.php for database access and ensure that your database connections are correct. As well as that your database user has full access.

Thanks Jim!  Ok, I'll move over to PHP 8.1.  Nice part about Plesk is I can do that easily in the hosting configuration.

As far as user/group, I see the files on my system are owned by root/root.  I'm wondering if Ubuntu is more restrictive when it comes to those files.  I'll check to see which user I should be using in my server configuration.  Very good advice!

I did notice that conf_global.php was pointing to a different location for mysql.sock.  I had to change it because Ubuntu shows a location of "/run/mysqld/mysql.sock"  (CentOS was /var/lib/mysql/mysql.sock).

Much appreciate the support, I think this will be useful information for others who are also doing the migration.  CentOS was a great platform but it went EOL and this might become a common request.

 

Thanks again, I will post when I get it fixed.

 

Mike

Link to comment
Share on other sites

Well, I've tried just about everything I can.  I don't think it's a permission problem.  I can run the ipb4.php file from the website, but Invision Forums doesn't work at all.

  • File permissions set
  • File ownership set

I am suspicious of the error "No Such File or Directory"

It's like the files don't even exist.  Any idea how this is possible?

Could contain: Text, Chart, Plot, Number, Symbol, Computer Hardware, Electronics, Hardware

Link to comment
Share on other sites

OMG, I figured it out just after writing this.  I had to change the value for mysqld.sock in conf_global.php.  I had it set to the wrong filename.  

Note to anyone making this change from CentOS to Ubuntu...  assure your conf_global.php is changed.  It's likely in a different location on Ubuntu.

In my case, mysql socket is located:

  • CentOS = /var/lib/mysql/mysql.sock
  • Ubuntu = /run/mysqld/mysqld.sock

Note Ubuntu uses mysqld not mysql

Link to comment
Share on other sites

One more change I had to make on the new Ubuntu system.  It looks like mod_rewrite is not included by default.  My forum root was showing fine, but it would always give me an error when I tried to select a forum.

Until I can figure out how to install mod_rewrite on Ubuntu, I had to disable "Rewrite URLs" option in the Admincp -> Search Engine Optimization.  It looks like .htaccess requires the module "mod_rewrite.c" which isn't on my new system.  I'll post here once I figure out how to install it on Ubuntu.

Could contain: Page, Text, File, Nature, Night, Outdoors

Link to comment
Share on other sites

Posted (edited)

Hey all, even after setting up mod_rewrite on my Ubuntu machine, I still cannot get it to work with IPB.  Anyone reading this have experience with getting the rewrite  to work properly?  From what I understand, mod_rewrite on Ubuntu is a bit of a pain (in general).

Here's what IPB gives me for .htaccess:

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map|webp)(\?|$) /404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I'm starting to wonder if this is correct or not...  any advice is appreciated.

Mike

Edited by Mike Gholson
Link to comment
Share on other sites

13 hours ago, Jim M said:

To confirm, you are indeed running Apache? Realistically, it would be your Apache configuration if mod_rewrite is installed properly.

Yes, Apache...  I've read something about this today:

Quote

If you plan on using mod_rewrite in .htaccess files, you also need to enable the use of .htaccess files by changing AllowOverride None to AllowOverride FileInfo. For the default website, edit /etc/apache2/sites-available/default:

    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            # changed from None to FileInfo
            AllowOverride FileInfo
            Order allow,deny
            allow from all
    </Directory>

After such a change, you need to restart Apache again.

 

Link to comment
Share on other sites

I'm not sure why it's not working.  I've followed all the instructions.

  • mod_rewrite enabled on server
  • added .htaccess to root (see below)
  • I keep getting warnings and rewrite doesn't work

Warning in IPB SEO settings:

Could contain: Page, Text

 

And my .htaccess file is here:

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico|map|webp)(\?|$) /404error.php [L,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

 

And I keep seeing this when I have Rewrite URLs enabled:

Could contain: Page, Text, File

Disabling Rewrite everything works fine.  But, I cannot migrate my other domains until this is fixed or it will totally screw up my monetization.

I know you guys don't like to help with server-side functions, but I simply don't know what else to do.

 

Mike

 

Link to comment
Share on other sites

Ok, I was able to finally figure this out.  My old system is running CentOS and that operating system has gone EOL.  There are some differences between apache and apache2.  If you're moving your board from CentOS to Ubuntu, you will likely run into some configuration woes. 

In order to enable modules for apache2, there's a symbolic link between the 'mods-available' directory and the 'mods-enabled' directory.  Look through the mods-available directory and find the module you want to load.  Then all you have to do is create the symbolic link to mods-enabled.  To make it easier on humans, Ubuntu has the awesome tool to do this for you called "a2enmod" (which I linked above).  This tool will create the symbolic link, thus enabling the mod (after restarting apache2).

For "mod_rewrite", I had to enable the "rewrite" mod (again, as noted above) and then restart apache.

However, this is NOT the last step.  You must now go to your "sites-enabled" directory and edit the .conf file of your site.

Make sure it has the following argument:

<Directory /var/www/YOURDIRECTORY>
        AllowOverride All
</Directory>

After doing this, also make sure you are using the .htaccess file as delivered by IPB.

Restart apache2.  mod_rewrite should now be running.

Mike

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...