logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Problem starting up 2.4: server root
Author
jabawa



Joined: 26 Nov 2012
Posts: 6
Location: Canada, Vancouver

PostPosted: Tue 27 Nov '12 3:27    Post subject: Problem starting up 2.4: server root Reply with quote

OK, I'm post-newbie: don't claim or want to be any kind of expert but have been running Apache on my Windows (now 7 but have been through XP and Vista) system for many years, using it as a test server for PHP/MySQL/HTML code before I upload to the web. Moved to Apache Lounge version of Apache when Apache.org didn't move to VC9 (2.2). Now trying to use VC10 (2.4).

I install (copy from the zip) Apache into c:/Program Files. With 2.2 I used folder C:/Program Files/Apache Group/Apache2 but for 2.4 I went to the simpler:

Server Root "c:/Program Files/Apache24"

Problem: on startup (from cmd httpd.exe -k install), I get an error message telling me that my server root directory is invalid. Any ideas? Is this a user account issue (I've made the httpd.exe run with admin privileges), or do I need the .../Apache Group to preceded the /Apache24? I tried httpd.exe -V and it showed a HTTP_ROOT as /apache but I don't know how relevant that is.

Appreciate any ideas but I'd rather not resort to the ultra-conservative "C:/Apache" solution until I've tried everything else thanks.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 223
Location: Denver, CO USA

PostPosted: Tue 27 Nov '12 5:00    Post subject: Reply with quote

I set my 2.4.3 installation directory to Apache24 under program files as well. I have my server root directive set as the following:

ServerRoot "/Program Files/Apache24"

Notice how I did not put the C: in mine?

Try that maybe and see if it works?
Back to top
jabawa



Joined: 26 Nov 2012
Posts: 6
Location: Canada, Vancouver

PostPosted: Tue 27 Nov '12 17:45    Post subject: Reply with quote

Thanks for the suggestion. It didn't work but you have at least confirmed that I should be able to run under Program Files/Apache24.

It also achieved something else. In making your change I incidentally changed the line number of serverroot to 57 but it still gave me an error for line 56. I'm now starting to vaguely remember having a similar problem before because of Windows' weird way of protecting files in Program Files. I must have circumvented that protection before so I'll have to figure out how to do it again.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Tue 27 Nov '12 21:36    Post subject: Reply with quote

It is a user account permission thing. Program Files is protected. The problem is most likely that your conf file changes are not being made, but you will always see the changes, just apache will not. Cause the conf file you are editing is a copy in the virtualstore c:\Users\username\App Data\Local\VirtualStore\Program Files\ApacheX\conf\httpd.conf

On anything Vista and above, you have to run your editor as Administrator. You will also need to be in a DOS Window running as Administrator to install/start/stop/uninstall the service from the command line.

No changes to /htdocs can be done except by Administrator. This is why it's suggested putting Apache under the drive root \Apache24
Back to top
jabawa



Joined: 26 Nov 2012
Posts: 6
Location: Canada, Vancouver

PostPosted: Tue 27 Nov '12 23:08    Post subject: Reply with quote

Yes, thanks for the confirmation of what I suspected. I had this problem when I first used Vista/7 but somehow worked around it and had forgotten the issue. My recent re-install Windows 7 brings it up again.

I'd rather solve this problem than install on the root. Program Files is for program files and installs (like Microsoft Office) that use the root are, in my way of thinking, untidy and undisciplined. Apache, for my usage, is an application.
Back to top
jabawa



Joined: 26 Nov 2012
Posts: 6
Location: Canada, Vancouver

PostPosted: Sat 01 Dec '12 1:26    Post subject: OK, success Reply with quote

I've solved this immediate problem and several others on the way to an Apache 2.2 solution running with PHP. For the benefit of others, here are some solutions.

NOTE That I install Apache and PHP in Program Files and it works fine from here.

1. If are going to be using PHP make sure you download the version of Apache that works (presently, this is 2.2.23 at the time of writing, not 2.4, even though there is an php5Apache2_4.dll!). Downloading the wrong version of Apache results in an error message that it cannot find the module (above) that you have also downloaded and is clearly located in the PHP dir.

2. If you're using Windows Vista or above watch for Microsoft's entirely botched implementation of new security for Program Files that results in the changes that you believe you are making not actually happening. Here's how to fix that problem:

- [In Windows Explorer] Right click the Apache folder
- Properties/Security
- Locate your user name in the list of owners
- Edit permissions
- Check "full control"
- Save and exit

Now your changes will actually happen

I've seen a lot of what I'll call voodoo--solutions that require sometimes extreme or arcane steps--for these issues all over the web. This isn't to imply criticism, there is probably some voodoo here. This is simply a reflection of what people resort to when there isn't clear documentation.

I'm very disappointed that Apache and PHP seem to have fallen back on or even abandoned their support for Windows. [/i][/b]
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 223
Location: Denver, CO USA

PostPosted: Sat 01 Dec '12 5:06    Post subject: Reply with quote

It is for that exact reason that I set myself up with an account as an ADMINISTRATOR on a server and/or workstation
Back to top
jabawa



Joined: 26 Nov 2012
Posts: 6
Location: Canada, Vancouver

PostPosted: Sat 01 Dec '12 5:21    Post subject: Reply with quote

It sounds as though you are in more formal--production?-- environment. I'm working at home on my laptop and I am set up as an administrator but Windows still gives me grief on this issue.

I'm continuing to have some problems. Had to go through the steps above for PHP and MySQL folders. And I also noticed that once when I changed the permissions, they didn't stick. But I went in and tried again and this time they stuck. Quirky.

Just to be on the safe side, it is probably worth making sure that any applications used to make changes to these folders are also "Run as administrator".

Frankly, I'm thinking about getting a Mac next but maybe it's just been a rough day.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 223
Location: Denver, CO USA

PostPosted: Sat 01 Dec '12 6:40    Post subject: Reply with quote

I have a production environment that is a Windows 2008 Server (which I log into as the Administrator). I run Apache and PHP on this machine.

I never had to make any changes to permissions on any folder to install and run Apache and PHP, just tweaking of .conf and .ini files.

I have a development environment that is a Windows 7 laptop (which I log into as a "regular user" that has full administrator privileges. I run Apache, MySQL and PHP on this machine.

Never had to make any changes to permissions on any folder to install and run Apache, MySQL, PHP and PHPmyAdmin on this machine, just tweaking of .conf and .ini files.

I also use a MAC for day to day use, but not yet installed Apache on it.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sat 01 Dec '12 8:54    Post subject: Reply with quote

I have most versions of Windows but the one on my laptop I use the most, which is Vista. In Vista, there is only two levels of the UAC, on and off, unlike Win7 where you can adjust it.

It's simple to just run anything as administrator w/o needing to log in as the actual Administrator. Just right click on a shortcut icon and choose "Run as Administrator." As long as your an Administrator level user it will bring up the nag and you OK it. Nothing hard about it.

Mac, that's OSX so basically similar to Unix/Linux and you will have to su to root to do things with Apache on it. Windows just finally got some file system security going for it.
Back to top
jabawa



Joined: 26 Nov 2012
Posts: 6
Location: Canada, Vancouver

PostPosted: Sat 01 Dec '12 17:48    Post subject: Reply with quote

Glad to hear that you escaped the problem but it is an recognized one (see glsmith's good description above and others elsewhere). And it is not the result of either inexperience or at the other extreme foolish tinkering. I've been using AMP on my system going back to Windows XP and never had this problem before. And I believe in keeping things simple so mine is a vanilla install; I too am designated an administrator.

It appears, judging by your experience that some get the problem and some don't. Who knows what the reason is for the difference.

Thanks for your responses.
Back to top
DnvrSysEngr



Joined: 15 Apr 2012
Posts: 223
Location: Denver, CO USA

PostPosted: Sat 01 Dec '12 20:46    Post subject: Reply with quote

Gregg:

You do make an excellent point. When I set my account on Windows7 workstations, pretty much the first thing I do is set me up as an Administrator and disable that pesky annoyance known as UAC. This how I have avoided issues with software installs not playing nicely.
Back to top


Reply to topic   Topic: Problem starting up 2.4: server root View previous topic :: View next topic
Post new topic   Forum Index -> Apache