My first Linux install, a few problems left.

Hi.

I’ve had a Debian installation that a friend of mine set up for me under my desk for years. It used to host a web site for a company I ran, and it still hosted a blog for my wife.

The other night I figured I better do something with it, as it hasn’t been updated since 2005. It only took me minutes to render it completely useless, so had to do a clean install. A “which linux distro is right for you”-quiz recommended I try OpenSuse, so I did.

It’s gone pretty well so far, for a person with almost no knowledge of Linux, but there’s a couple of issues left that I can’t sort.

I’ve installed apache2 with php5 and mysql. In mysql I created a new database for the missus’ blog (wordpress) with the same name as on the last install. I then stopped the sql server and copied back the original database files, overwriting the single new file created by mysql.

Now I can use “www.site.com/wp-admin” and see all her old posts and pages and such, but I can’t change anything. I add a new page, and it doesn’t show, I delete an old page and it’s still there. Something I didn’t think about (or more correctly: didn’t know about) with MySQL here?

And when I browse to “www.site.com” I just get a blank page. At first I thought my vhost thing had to be wrong, but then the wp-admin wouldn’t work, would it? I’ve had to do some changes here, I forgot to back up my old “sites-enabled” files, and anyway the new install seems to prefer vhost.conf files.

I’ve worked on it for hours and hours now, so I’ve given up figuring it out for myself for now, so any input would be appreciated.

I barely know anything about database and site/blog engines,
so I can only guess.

Have you checked, do files which you have copied
have right permissions or/and file owner?

P.S. I think it’s better to chose
a little bit more specific thread topics,
which tells about your problems right away.
‘MySQL troubles’ or something like that.

Hi.

No, I haven’t checked file permissions and owners, don’t know how to do it, and what the right owner/permission is.

And regarding the subject, I thought there’d be more problems in my list then there actually was (that I know of, will probably turn up more). I sorted some php5 stuff and those vhost.conf files, while there still might be something with the apache, since I can read content when in wp-admin but get nothing on the actual blog.

Here’s a question before I actually start anything else; did you actually copy the files physically from the Debian installations MySQL directory instead of exporting the database with the mysqldump or phpmyadmin?

Yeah, mounted a usb drive, stopped mysql, copied the files, copied them back from a network share. Exporting sounds smarter, though. Should have asked BEFORE I did it.:stuck_out_tongue:

Without taking too much of a peek into the database files themselves, my “out of the blue” assumption is that the permission tables are broken - a mysql_fix_privilege_tables command may fix the tables but it won’t fix the broken permissions if they exist.

Did you create a new user for the database and grant it suitable permissions to the blog database? If not, you might want to check that route - after running the privilege fix.

Of course, at all times keep the original data safe somewhere.

Thanks, did mysql_fix_privilege_tables, and got “done”. Don’t know if it fixed anything.

Still can’t change anything, but got read access. Is there any log I can check or enable and then check for MySQL?

Did chmod 777 . in the folder where the database files, and now I can edit again. I’ll worry about the security later, I’ve disabled the access rule in the firewall anyway.

But I’m still getting a blank page when I try to open the website from my LAN. (I’ve added the private ip addresses to the host files, so it’s not a problem with nameresolution or firewall issues). Any suggestions?

When I view source on the blank page I see some html code, is there a function where I can search for contents of file, so I can find where it gets this file from?

drive-by suggestion, have you checked the services are running ? Go to YaST - system - system services ( runlevel editor ) & check apache et-al are running

Andy

Look at /var/log/apache2/error_log

Most likely if you’re getting an empty page one of the modules is missing, you have a permission problem or you’re using “short tags” which have been disabled for quite some time ( <? as opposed to <?php )

It’s also possible that you’re getting a php error and the page is empty because it doesn’t output any of the error messages on screen, to alter this behaviour you’ll need to (temporarily) edit /etc/php5/apache2/php.ini and change the error log level there. error_reporting = E_ALL would dump all errors on the web browsers output - however that is only for debug purposes (like yours) (change to that file only takes effect after an Apache restart - rcapache2 restart as root would do that).

If your .php files have <? at the start of them that means you’re using short_open_tags which need to be enabled in the same file to function properly.

PHP doesn’t by default output any error messages on the screen so you won’t see them there, that would need raising the error log level / debug level in /etc/php5/apache2/php.ini

Got it working. :slight_smile:

Had to reapply theme inside WordPress and it was up and running. One final question: What security level should I have on my db files? I set them to 777, but I guess that’s not optimal?

Normally mysql files are owned by the mysql user and the mysql group with 700 for the directory and 660 as permissions for the files, at least on my installs.