[SOLVED] Local webserver for PHP/CMS websites. what to ins

Questions about applications and software
Forum rules
Before you post please read how to get help
Post Reply
Peter20ghz
Level 2
Level 2
Posts: 78
Joined: Tue Jan 19, 2010 1:47 pm
Location: Sweden
Contact:

[SOLVED] Local webserver for PHP/CMS websites. what to ins

Post by Peter20ghz »

I have for the moment a very limited Internet connection. (mobile 3G max 2GB trafik/week) so i cant work as i used to with sending files back and forth trough my different servers and computers.
So i have decided that i want to have my own webserver in my desktop PC. The server shall be able to handle different sites, like standard static html web sites, as well as Shoppingcarts e-shops in PHP like magento/os2commerce, and CMS systems like Drupal, joomla, wordpress etc etc. I would like to be able to have them all on my lokal PC with a webserver. All of these are more or less depending of a database sql, so it must be able to handle that too.
I have never installed a local webserver before, never had the need since i allways have had a good connection (fiber 100/100mb/s) and its been just as fast as transferring the files in-house.
So i really need help with this, what is it i need? Is there any "easy" server suites with a graphical GUI? what "modules" should i get? Are there maybe already bits of it installed with mint "out of the box"?
Itś important that its easy to understand and preferable with a gui.
Ive looked around a bit but so many names of servers sounds like the same but is not, doing almost the same things but yet not, so i really dont know what it is i need.

If any one can please come with a suggestion that cover what i need i would be very thankful

Best regards
Peter
Last edited by Peter20ghz on Fri Apr 30, 2010 4:52 pm, edited 1 time in total.
User avatar
DrHu
Level 17
Level 17
Posts: 7522
Joined: Wed Jun 17, 2009 8:20 pm

Re: Local webserver for PHP/CMS websites. what to install??

Post by DrHu »

Opera 10 comes with a built-in local web server setup
http://www.opera.com/press/releases/2009/06/16/
  • Opera today unveiled Opera Unite, a new technology that shakes up the old client-server computing model of the Web. Opera Unite turns any computer into both a client and a server, allowing it to interact with and serve content to other computers directly across the Web, without the need for third-party servers.
http://tech.slashdot.org/story/09/06/19 ... enchmarked

LAMP stacks. local web serving..
If you don't use Opera, then install a LAMP stack or a lightweight web server along with an IDE or even a simple editor to code the web pages, like php editors
http://www.linux.com/archive/feature/47083
http://www.kabatology.com/05/12/how-to- ... mp-server/

Faster web servers..
http://royal.pingdom.com/2010/02/23/ngi ... he-giants/
--you may also want to do dns browser caching locally to speed up your internet access..
http://www.cyberciti.biz/faq/howto-run- ... root-jail/
http://www.howtoforge.com/installing-ph ... ntu-debian

In terminal, check
  • apt search dnscache
    p dnscache-run - djbdns dnscache service
http://www.ubuntugeek.com/local-dns-cac ... chine.html
Peter20ghz
Level 2
Level 2
Posts: 78
Joined: Tue Jan 19, 2010 1:47 pm
Location: Sweden
Contact:

Re: Local webserver for PHP/CMS websites. what to install??

Post by Peter20ghz »

Thanks a lot DrHu, Seems like i got a few suggestions to read up on.
Are any of this to your knowledge more user friendly than the others?
I beleive i probably need it as easy and user friendly as possible to be able to do it right. :-)

Thanks again.
Peter
Peter20ghz
Level 2
Level 2
Posts: 78
Joined: Tue Jan 19, 2010 1:47 pm
Location: Sweden
Contact:

Re: Local webserver for PHP/CMS websites. what to install??

Post by Peter20ghz »

Yes, it didn't take long before i got lost.

I followed the guide here for the nginx server + php5
http://www.howtoforge.com/installing-ph ... ntu-debian

I followed it to the dot, copy and paste in terminal step by step, and as far as i know it looked all right.
But somehow, it looks like the nginx is not working or maybe its something else that is wrong.
I also couldn't get an error log from the server as explained in the end of the guide.
peter-office-linux tmp # sudo tail /var/log/nginx/error.log
2010/04/29 08:36:31 [emerg] 6927#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2010/04/29 08:36:31 [emerg] 6927#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2010/04/29 08:36:31 [emerg] 6927#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2010/04/29 08:36:31 [emerg] 6927#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2010/04/29 08:36:31 [emerg] 6927#0: bind() to 0.0.0.0:80 failed (98: Address already in use)
2010/04/29 08:36:31 [emerg] 6927#0: still could not bind()
To me it seems that its a apache server running already, can that be so?
That is in a way ok, as long as a webserver is installed and working. but what the heck happened to nginx? :?:

And when i went to test install a web-shop i get error message regarding the database.
Database Server is available but database is not found.
Is there anything more i need to do to make a database work?
Normally i log on to myphpadmin and create/edit/delete a db
Where can i do that here?

And finally, as i always want to know, where have all the stuff been installed? Where could i locate the different applications to see if i can figure out whats wrong?

Anyway, im a bit on the way and thats great, it would just be greater if i knew more of what im doing.

//Peter
User avatar
markfiend
Level 4
Level 4
Posts: 310
Joined: Wed Apr 15, 2009 2:56 pm
Location: Leeds, UK

Re: Local webserver for PHP/CMS websites. what to install??

Post by markfiend »

There's a guide to installing the LAMP stack here: http://forums.linuxmint.com/viewtopic.php?f=42&t=22034

Worked for me!
Omnia mutantur, nihil interit.
Peter20ghz
Level 2
Level 2
Posts: 78
Joined: Tue Jan 19, 2010 1:47 pm
Location: Sweden
Contact:

Re: Local webserver for PHP/CMS websites. what to install??

Post by Peter20ghz »

Thanks, it looks similar to what i have installed.
But i think i didnt have phpmyadmin part installed and i went to start from there.

But;
sudo apt-get install phpmyadmin
[sudo] password for peter:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
phpmyadmin: Depends: php5-mcrypt but it is not going to be installed
E: Broken packages
So i went to package manager to see if i could install php5-mcrypt from there;
php5-mcrypt:
Depends: libltdl3 (>=1.5.2-2) but it is not installable
seems like a dependency (libltdl3) is needed, but its not anywhere to find.

Is it safe to start a totally new install of everything with maybe different versions or so to see if its better luck?
User avatar
DataMan
Level 6
Level 6
Posts: 1234
Joined: Thu Dec 04, 2008 6:47 am
Location: Carmel, Midwest USA at /var/www
Contact:

Re: Local webserver for PHP/CMS websites. what to install??

Post by DataMan »

For LAMP:

Code: Select all

$ sudo tasksel
Check the LAMP checkbox (space bar). DON'T UNCHECK ANYTHING THAT IS ALREADY CHECKED!!!

Follow the dialog prompts.

This will install Apache web server, PHP parser and a MySQL database server.

Note : these are full-featured and do not lend themselves to casual GUI interfaces ( you'll probably need to get immersed into programming code in short order).

My recommendation is to stay with DrHu's recommendation of using Opera as it appears to be the most benign way to start on a web server for a novice.

-DataMan
Linux'd since 2005 Linux ID 422356 Ubuntu ID 15015
Peter20ghz
Level 2
Level 2
Posts: 78
Joined: Tue Jan 19, 2010 1:47 pm
Location: Sweden
Contact:

Re: Local webserver for PHP/CMS websites. what to install??

Post by Peter20ghz »

Yes i tried that, but i didnt get much dialogbox, except something about if i was sure that i wanted to do this.

Sadly it havent done anything different.
I mean the appache2 is there, the php5 is there, but i dont think i have a mysql, i only find postgresql wich also is a sql server offcourse.

I still can surf my local websites from localhost, but database management dont seem to work proper.
postgresql has a "myadmin" interface too phpPgadmin, in there i see that i have a server running, but i cant log on to it to build DBś. it just keep on saying, log in failed. And when i thionk of it, i dont think i ever got to a part where i set a sql user/password so its kinda hard to log on then.

Do you guys run MySql server or do you use this PostgreSQL server?

I feel that somehow my appache, nginx, mysql postgresql, php etc.etc have maybe started to affect eachother?
Should i just remove it all, uninstall, (if so, how?) or is it not there the problem is?

And whats up with the error in the synaptic when i want to install phpmyadmin.
the install is dependent of php5-mcrypt but it is not going to be installed
Trying to mark php5-mcrypt manually, and it asks for another dependencie
Depends: libltdl3 (>=1.5.2-2) but it is not installable
Itś not even on the repos and can therefor not be installed.
How do you guys get your phpmyadmin installed?

Im stumped.
And yes, i looked at opera, i actually allready had it installed, and no, i dont like it, and it couldnt handle php or sql it seemed like. No i wanna learn the real webserver stuff. but must be able to get it installed proper first.

Well, im more confused now then i was earlier, but im learning so its ok.

//Peter
Peter20ghz
Level 2
Level 2
Posts: 78
Joined: Tue Jan 19, 2010 1:47 pm
Location: Sweden
Contact:

Most probs solved, ONE NEW.

Post by Peter20ghz »

Well, i tried a few more ways, but couldn't fix it, so i cleared out most of what i believe i had installed, some libfiles probably was left. then i went to wiki for read about lamp installers and found a pack from bitnami i think its called.
They had many pre/configured packs for people wanna install for lets say,WP, joomla, ruby and so on.
I choose a plain pack with a native bin installer. The installation process was just what i wanted, just click, click, enter password x 2, click, done. And it was all installed, after that it sent me to myphpadmin that worked fine as well. i even created a DB to test.

All seems just fine, except it wont let me read php files in FF, it rather wants me to download php-files, i just get the litle window asking me to save or open the file when i browse a local php page..
What can be the problem here? php5 was installed in the lamp pack. where to look, i tried the most thinkable conf files i could think of.

Im sorry if im maybe posting to many stupid questions, but i need to learn and where else to go when google wont give me what i need.
User avatar
DrHu
Level 17
Level 17
Posts: 7522
Joined: Wed Jun 17, 2009 8:20 pm

Re: Local webserver for PHP/CMS websites. what to install??

Post by DrHu »

Peter20ghz wrote:All seems just fine, except it wont let me read php files in FF, it rather wants me to download php-files, i just get the litle window asking me to save or open the file when i browse a local php page..
Sounds normal, since a file is not a web page, or is it..can Firefox read your local website pages
http://support.mozilla.com/en-US/forum/1/561694

https://support.mozilla.com/en-US/forum/1/229943
http://support.mozilla.com/en-US/forum/1/568843

Firefox and PHP code..
http://www.phpdeveloper.org/news/7279
https://addons.mozilla.org/en-US/firefox/addon/60
--web developer extension for Firefox..
Peter20ghz
Level 2
Level 2
Posts: 78
Joined: Tue Jan 19, 2010 1:47 pm
Location: Sweden
Contact:

Re: Local webserver for PHP/CMS websites. what to install??

Post by Peter20ghz »

Hello.

I was maybe not very clear.
But earlier i was able to do just that in firefox, i opened localy stored files in my "var/www/" folder and it could read the php page(installer for e-shop)

But now i try to open same link but insted FF want to DL it insted, its still the very same file.

Im gonna see what your links are about now.

Thanks
Peter
Peter20ghz
Level 2
Level 2
Posts: 78
Joined: Tue Jan 19, 2010 1:47 pm
Location: Sweden
Contact:

Re: Local webserver for PHP/CMS websites. what to install??

Post by Peter20ghz »

Ok now i have looked around a bit, and well it seems like my new problem is in FireFox and not in my servers.
That is good to know, means my servers are now installed proper and works.
But what happend to my FF? When i uninstalled everything earlier that i thought was affecting the webservers, did i maybe uninstall anything that FF needs to be able to know what to do with .php files? Normally when you install FF from the box it knows how to parse php files.
I came to this conclusion when i tried to open same localhost page in opera, it read it perfectly as suposed to, so that tells me the servers are working and the problem must be in FireFox.
Anyway to figure out what can be missing? Or shall i uninstall and reinstall FF?

//Peter
Peter20ghz
Level 2
Level 2
Posts: 78
Joined: Tue Jan 19, 2010 1:47 pm
Location: Sweden
Contact:

Re: Local webserver for PHP/CMS websites. what to install??

Post by Peter20ghz »

OK.

I am now officially a newbie :-)

Im sorry, but i forgott to check if servers was running correct and all that.
Somehow the appache and mysql had stopped, and thats why it couldnt be parsed in FF. Why opera managed to do it i cant say, maybe quz its own server functions.
But after i found the command for start the server and i run it, all works well.
So i should have checked that first, that the servers were running, could have saved me and you some time, sorry for that.
But atleast i learned something today.

Thanks you all for your help.

//Peter
Post Reply

Return to “Software & Applications”