Page 1 of 3

Help to make a web server, please?

Posted: 12 Dec 2010, 21:55
by rolf
I searched and found Fearless Leader's 5 pages about ArchServer, which ended in whiskey, which is not an option, so I'll start a new thread. :greetings

GF has a beauty salon small business and asked me to make an internet presence for her. I'm networking dumb but do have a small lan at home that I can make some use of, currently:
Image


All the boxes/appliances are wired to the Linksys with the eeep coming to visit for updates over wireless, once in a while. Both desktop machines are running Mandriva 2010.1 I've read, a little, and bought us a domain from domain.com, installed ddclient, and that's about where I'm at. Well, I've looked at the commented config files, a little, but don't know where to start and this is concerning:

Code: Select all

[root@localhost rolf]# chkconfig --list ddclient
ddclient        0:off   1:off   2:off   3:off   4:off   5:off   6:off   7:off

I've played with the NFS wizards in MCC, without success, got ushare working, somewhat, only after disabling personal firewall and relying on the router's defenses, iirc:

Code: Select all

[root@localhost rolf]# chkconfig --list iptables
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off   7:off

Nonetheless, ShieldsUP!! at http://www.grc.com tells me, "Your system has achieved a perfect "TruStealth" rating. "

Ok, that's what I guess is important information, glad to provide more. If someone could point me to a good place to start reading and/or walk me through, a little, I would be grateful! :cheers

Re: Help to make a web server, please?

Posted: 12 Dec 2010, 22:51
by viking60
Ok it is important to baby step here. (mainly due to my lousy simultaneous capacity :D ). You may or may not have a lamp server running that is the first step:
1. Install task-lamp-php

Code: Select all

urpmi task-lamp-php

Don't try task-lamp or any other stuff, you will only get fubared later on. (The meta packages are not all that good always).
This will install the complete server with Apache, mysql, and php

If you have installed the standard server via MCC remove it before you do the step above (You don't get the integrated php and mysql there if I remember correctly).

2. Start mysql and configure it with

Code: Select all

/usr/bin/mysql_secure_installation


Hit enter
and provide a user password for the mysql root user (Has nothing to do with the Linux root user)
This is fairly good described in my Wiki here

You might need to restart your computer to get this going to start all the necessary services.

Now you have a working server with html and php and mysql. You will be needing phpmyadmin (or something else) to populate your databases, If it is not installed with the meta package you must install it now.
restart and go to http://localhost/phpmyadmin and log in with
userid: root
password: <The one you provided when configuring mysql>

For control panel webmin is fine.

OK this takes care of the server now over to getting it online:
ddclient is only for services like dynds and it is a fine instrument for testing your server online (in fact you can use it permanently).
ddclient sees to that if your ISP renews the provided IP that the website is renewed too so that it can stay online.

On the router side of things you have to assign the official IP to the server (PC in your network that holds the server above). and you have to configure the dyndns account with your data at dyndns. combined with the ddclient that you have automatically generated at dyndns it will put your server out there.

BUT there are ISP's that suck and there are routers that suck - so you cannot be sure. The ISP should be able to answer questions regarding that. (And they will most likely start talking about byeing fixed IP addresses -say no until you have tested dyndns if possible).

Does anybody have a botle of wiskey to lend me? Mine seems to be empty.

Anyway here are some more threads where I have committed some help have a good look at my links in this one:
http://forum.mandriva.com/viewtopic.php ... asklampphp
That will give you something to study.

After that there is only one thing left setting up the NS and pointing the fixed IP - and I suck at that but lets take it when we get there :shock:

Re: Help to make a web server, please?

Posted: 13 Dec 2010, 00:00
by rolf
Woot! :dance:

From the beginning, urpmi task-lamp-php required I make two choices and I chose:

php-gd-bundled
mysql-max

There was nothing mysql running and /usr/bin/mysql_secure_installation failed. I found

Code: Select all

[root@localhost rolf]# chkconfig --list|grep mysql
mysqld-max      0:off   1:off   2:on    3:on    4:on    5:on    6:off   7:off


and wound up doing

Code: Select all

[root@localhost rolf]# mysqld-max
101212 14:29:59 [Note] Plugin 'ndbcluster' is disabled.
101212 14:30:01  InnoDB: Started; log sequence number 0 44233
101212 14:30:01 [Warning] Storage engine 'SPHINX' has conflicting typecode. Assigning value 43.
101212 14:30:01 [Note] PrimeBase XT (PBXT) Engine 1.0.09e RC loaded...
101212 14:30:01 [Note] Paul McCullagh, PrimeBase Technologies GmbH, http://www.primebase.org
101212 14:30:02 [Note] Event Scheduler: Loaded 0 events
101212 14:30:02 [Note] mysqld-max: ready for connections.
Version: '5.1.42-Max'  socket: '/var/lib/mysql/mysql.sock'  port: 0  Mandriva Linux - MySQL Max Edition (GPL)


From there, I followed your wiki and

Image
Image

So, thanks a lot, so far! I'll read your next links by and by. (Maybe I will do the distro upgrade from 2010 to 2010.1) :s

Re: Help to make a web server, please?

Posted: 13 Dec 2010, 09:58
by viking60
Good job! :s

Re: Help to make a web server, please?

Posted: 15 Dec 2010, 17:09
by rolf
I've got to this point:
restart and go to http://localhost/phpmyadmin and log in with
userid: root
password: <The one you provided when configuring mysql>


I can see the web interface and, for reference, put a copy here: http://dl.dropbox.com/u/1286780/lan/index.php.html

I don't know what to do to "populate databases" and all the html authoring I've done, so far, is make simple web pages in Composer, like: http://home.mindspring.com/~rolfpedersen2/jobs/

Could get a little fancier for GF's website but don't know how, exactly, atm.

I had gone to dynds at first but it was down for maintenance, so I bought the domain at domains.com. It seems to me they offer for free the dynamic dns thingy, which we need over the adsl/dynamic ip account I've got, so I'll go through that configuration or transfer the domain, if need be but I don't think it's needed.

So, how does it look to you?

Re: Help to make a web server, please?

Posted: 15 Dec 2010, 19:22
by viking60
Phpmyadmin looks completely normal and as it should be :s
You can create a database by simply entering a name in the create new database field. And hitting enter.
Like "forum" then you can download and unpack phpbb (this board) or Joomla and start follow the install instructions when asked for the name of the database you just enter "forum" (or the name you created) and the database will be populated for you by the script.
That is all you need to publish your own CMS or Forum. or everything here
The advantage is that you can create interactive websites not only static html presentations. It also is easier to maintain when you put your scripts in a database.
I have made a CMS (Content Managament System) http://bjoernvold.com and my own database. You can have a look at it register and play around. If you like it I will let you have a copy.
I have encrypted some of the code for security reasons so it is not fully open source (yet!).

To test your php installation to see what you have installed, you can open an editor and type

Code: Select all

<?php
echo "here is a little info about your server:";
phpinfo();
?>

:coffee_cup:
And save it as info.php on the root of your server.
Then you go to http://localhost/info.php and have a look at what you have installed and all your settings. It is useful for tweaking and checking your extensions.
(Also it will be easier to find the answer to all odd questions asked there ) :tux5:
Remove this file before you go public.

Re: Help to make a web server, please?

Posted: 16 Dec 2010, 01:14
by rolf
Ok, I will study some more (during GF-free time ;) ), tinker some more (ibid), and report back.
I get a hernia repair Friday and some little down time afterward, I expect, to complete online traffic school before 12/20 and make web development progress. I think it's coming along nicely, thank you very much! :greetings

Re: Help to make a web server, please?

Posted: 16 Dec 2010, 22:16
by viking60
No more heavy lifting there then = lots of computer time :tux5:

Re: Help to make a web server, please?

Posted: 19 Dec 2010, 20:04
by rolf
Ok, from the scripts site you linked, I chose Uiga Business Portal and downloaded from the developer site. Here's the manual: http://www.scriptdevelopers.net/userman ... al.html#si
Looks like some typos, ESL, there; I was confused by what is "localhost Director" but wound up putting the zip contents in a separate folder (not in the zip file), uigabusinessportal under DocumentRoot "/var/www/html", created the indicated database, and imported the indicated 424619_uigabusinessportal.sql file in the db/ directory. However, when I go to http://localhost/uigabusinessportal/ per the instructions, I get,
MySQL connect failed. Access denied for user 'root'@'localhost' (using password: NO)

httpd is running and I restarted it.
mysqld is running and I restarted it.

Code: Select all

[root@localhost lan]# service httpd restart
Shutting down httpd:                                                                              [  OK  ]
Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
                                                                                                  [  OK  ]
[root@localhost lan]# netstat -ln | grep mysql
unix  2      [ ACC ]     STREAM     LISTENING     9897   /var/lib/mysql/mysql.sock
[root@localhost lan]# service mysqld status
[root@localhost lan]# service mysqld restart
Shutting down MySQL: ....                                                                         [  OK  ]
Starting MySQL: .,                                                                                [  OK  ]
[root@localhost lan]# netstat -ln | grep mysql
unix  2      [ ACC ]     STREAM     LISTENING     99074  /var/lib/mysql/mysql.sock


So, apropos of the forum, :S HELP!!!!

Re: Help to make a web server, please?

Posted: 19 Dec 2010, 20:35
by viking60
Look for a config file in the folder. You probably failed to give the correct connection info during installation.
In that you will probably find something like this:

Code: Select all

    $_DB_HOST = "localhost";   //Usually localhost
    $_DB_PORT = "";           // You can usually leave this empty
    $_DB_NAME = "the name of your database";      // Enter the database here
    $_DB_USER = "root";     // Enter your user ID here
    $_DB_PASSWORD = "your password created during mysql_secure_installation";    // Enter your password here to finish!


And you are using password YES :idea:
It should be possible to correct this by some simple text editing.

Have you checked that the data and the database are all there in phpmyadmin?
(It is common that you need to create the database BEFORE you install and provide that name during the install process)
You have placed the portal correctly under /var /www/html (if you have not changed the path - I always change it to ~/public_html) So check your Chmoding (especially for the config.php file).
Your daemons seem to be running just fine!
Edit:
You are looking for admin_config.php and config.php in the library folder
And this in particular

Code: Select all

$dbHost = 'localhost';
                  $dbUser = 'root';
                  $dbPass = '';                  
                  $dbName = '424619_uigabusinessportal';

Check your password there and also the db name - the user is correct already.

Re: Help to make a web server, please?

Posted: 19 Dec 2010, 21:18
by rolf
Image


I think everything imported ok. I did find a db.php file with the values you indicate. I edited it:

Code: Select all

# cat /var/www/html/uigabusinessportal/db.php
<?
$db_host = "localhost";
$db_name = "424619_uigabusinessportal";
$db_user = "root";
$db_password = "***";
?>


But the error at http://localhost/uigabusinessportal/ remains.
MySQL connect failed. Access denied for user 'root'@'localhost' (using password: NO)

even after restarting daemons.
I wonder if adding the layer of placing the extra directory, uigabusinessportal, under /var/www/html/ could cause a problem. Thanks for the expert advice!

Edit: There is admin_login.php under the top level admin/ folder: http://dl.dropbox.com/u/1286780/admin_login.php I don't know if this affects the problem.

Re: Help to make a web server, please?

Posted: 19 Dec 2010, 21:41
by viking60
NO as you will see that one just calls the file in library. You could try to change its permissions though.
The folder is just fine, You need to have all those files in a separate folder.
in http://localhost/phpmyadmin
is the database (424619_uigabusinessportal) present and filled with data?
It should look like this:
Image

Uploaded with ImageShack.us
If so try to chmod the config files in library to 777 (for testing)
If that fails I'll install it here to check out whats wrong (not all scripts are perfect).

Edit: I think I know what we have to do here:
1 goto phpmyadmin
2 copy and paste 424619_uigabusinessportal into the create new database field and press go
3 Go to the import tab and browse to the file in the db folder that is called 424619_uigabusinessportal.sql and import it and press go