Jump to content

Setting up my site serving system...


Ciinien
 Share

Recommended Posts

This will get a little long, for that I apologize in advance. However, I am about to the information overload point and need a little help/advice... :wall: (NOTE: I'm having to edit this on the fly because the forum's "preview" functionality is broken and it posts every time instead of previewing... rofl)

 

Running a 10-Official system, upgraded from 10-CE as the rpms became available. I installed Webmin and it has helped some, as far as finding things and helping to bring servers online more easily--thanks, Jamie!

 

I've managed to get most, if not all, critical systems up and running at this point. I still don't have my CD-R and CD-RW acting properly, sound and RW wise, but I can access them when needed for software updates so I'lll worry about ALSA and Sound Server playing well together later. Right now I am just trying to get my servers set up to transfer my web site from my Windoze XP Pro box to this box, the MDK 10 one.

 

A great deal of my problem stems from the fact that Mandrake, for some reason, doesn't install it's pacakges where most tutorials tell you to look for them. In other words, if a given tut tells me to look in, for example, /usr/local/<wherever>, mandrake has probably put my stuff in /home/ciinien/Documents or some such stupid place. I get so frustrated trying to play detective and track down where MDK puts some of my apps and stuff... :screwy:

 

I have read so many posts, forums, doc sets that I am simply overwhelmed at this point with information. What I'm asking here is a lot, but if someone could please "simply" walk me through setting up Apache to serve my site, I'd greatly appreciate it. Here's where I am so far:

 

Apache is up and running--test page comes up fine. MySql is up and running but for some reason I can't get to the test page for it. I don't have write permissions (non-root user) for the /var/www/html directory and can't figure out how to give them to myself using chmod. I have written a small test.php script to check my web site (relocated to /var/www/html/bsdlabs) to do this but I can't seem to get to that directory either--permissions again.

 

I have tried to make sure all the configuration files (Apache, MySql, etc.) have the proper pointers, links, symlinks, and so forth that are needed but still can't seem to get this working. Ergo, I finally asked for help here, where I know one or the other of you old vets have been here and done this successfully. Please pardon the fact that I am too thick to get all this but I'm trying to learn so much at one time I guess I'm just brain-dead at the moment.

 

Again, thanks in advance for any help and/or advice.

 

Cheers!

Ci

Edited by Ciinien
Link to comment
Share on other sites

Firstly, to my mind, mysql doesn't have a "testpage". Its a database, you enter the mysql front end either through a terminal or through a php script (like this forum does) to read and write data which is stored in a tabular format.

 

/var/www/html is owned by root, for security reasons, as you might imagine. If your system had more than one user you wouldn't want them to all be able to change your webserver's front page. To change this do: "chown username /var/www/html" where username is, your username. You'll now be able to change the files in there and setup your site.

 

Mandrake might put things in non-standard places, but in my experience, apache is a lot easier to use on mandrake than some other systems

 

have fun!

 

-fissy

Link to comment
Share on other sites

Here's my way to move files to my local server:

 

1) create a new "Link to Application" by right clicking on desktop. Name this "Super Konq" and link it to "kdesu konqueror"

 

2) use this "Super User" konq browser to move, copy, delete my website files to /var/www/html folders.

 

Just to be sure... you can use a browser and get the Apache test page by going to:

127.0.0.1/bsdlabs

or

127.0.0.1

???

Link to comment
Share on other sites

Firstly, to my mind, mysql doesn't have a "testpage". Its a database, you enter the mysql front end either through a terminal or through a php script (like this forum does) to read and write data which is stored in a tabular format.

 

/var/www/html is owned by root, for security reasons, as you might imagine. If your system had more than one user you wouldn't want them to all be able to change your webserver's front page. To change this do: "chown username /var/www/html" where username is, your username. You'll now be able to change the files in there and setup your site.

 

Mandrake might put things in non-standard places, but in my experience, apache is a lot easier to use on mandrake than some other systems

 

have fun!

 

-fissy

I think you probably misunderstood me, fissy... ;). I'm not grousing about not liking MDK. Quite the opposite as a matter of fact. At any rate, I will try the suggestions offered by both of you to see if I can get things going my way on this web site thing.

 

Cheers!

Ci

Info

Link to comment
Share on other sites

First, I grouse about Mandrake moving stuff all the time.

Your actually a good example WHY I grouse :D

 

that said.

Fixing the website (HTML) should be easy enough.

The user is I think www

 

I leave the web stuff in /var/www/html all owned by user www in group www.

chown -R www:www /var/www/html

then i make sure apache uis running as www

 

ps -ef |grep http

(It should be)

 

Then i add the www group as a secondary group to my regualr user...

(I do this manually in /etc/groups) you can use kuser but I hate the wizards becuase they always seem to do sometihng undocumented hence I stay well away from them.

 

Then I add READ/EXECUTE permissions to group and owner

chmod -R 550 /var/www/html

 

and sometimes give write to the directory itself.

(you can open it up at 550 or even 770 and then tighten once its working :D )

 

That should sort out the static....

 

second stuff is to check the mysql.

I often use locate and then find a package Im looking for ...

Im presuming your looking for the mysql test stuff.

(Im at work on WinBlows now!)

I use locate and find the package by using the details/files in add/remove progs! I know what you mean about MDK and the documentation. You get used to it :D

 

Make sure mysql is running as mysql etc and that you have the irght user/group.

Make sure you can use the test stuff .... and mysql is actually running and starting

/etc/init.d/mysql status (or stop/start)

 

 

My hint for the day is to learn UNIX permissions (the 777 stuff)

I KNOW Ive posted this lots.... do a search on that ..... once you have it its much easier to understand WHY :D I can understand your confusion if you dont :D

 

Scoopy's trick with konqueror is good, (obviously you need to be VERY careful running it as ROOT) but once you do you can use it to set permissions. However they are actually really easy once you understand the trick so its better to understand.

Link to comment
Share on other sites

Thanks for all the help and suggestions. I finally stumbled around and got my /var/www/html permissions set to allow me to write and execute properly. However, I don't think the initial install set php v4.3.4 up properly because I am having an extremely hard time locating all the files causing the following errors (the file test.php is from the php installation documentation to check for proper installation):

Warning: main(config.php): failed to open stream: No such file or directory in /var/www/html/test.php on line 2

Warning: main(): Failed opening 'config.php' for inclusion (include_path='.:/usr/lib/php/:/usr/share/pear/') in /var/www/html/test.php on line 2

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/test.php on line 3

Warning: mysql_select_db(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /var/www/html/test.php on line 4

Warning: mysql_select_db(): A link to the server could not be established in /var/www/html/test.php on line 4
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

 

Needless to say, none of these files are where they should be according to these error messages and I can't track them down using locate, find or whereis. I am just about to pull my hair out (what little I still have... :angry: ) over MDK's file location strategy. I have even gone through the directories, starting with /, by hand from a terminal and still cannot find most of these files.

 

I'm about to the point of completely reinstalling MDK and hand-picking the files it installs just so I know for sure it has all the proper ones on the computer--somewhere... lol

 

Cheers!

Ci

Edited by Ciinien
Link to comment
Share on other sites

i imagine the ones with sql wouldn't work because you haven't started mysql?

As for the first two errors, they don't sound like there is anything actually wrong with your php install, just that you're missing half the test files.

 

Try making this file (index.php) and viewing it through your server (http://localhost/another-test/index.php):

 

<html>

<head>
<title>this is a test!</title>
</head>

<?php
print "hello world!";
phpinfo();
?>

</html>

 

edit: sorry if this post sounded like i was talking down to you, i'm tired :(

Edited by fissy
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...