Forum Moderators: phranque

Message Too Old, No Replies

Suggestions for an Apache CONF IDE

         

csdude55

7:39 pm on Jan 17, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Any suggestions on a program or website that has a good IDE for Apache configuration? It's quite the pain to constantly upload, restart Apache, wait 30 seconds, test, repeat...

I've been using this one, which works well but it's really for htaccess and somewhat limited:
[htaccess.madewithlove.com...]

JDoodle has every language under the sun EXCEPT for Apache :-/ It has at least 12 languages I'd never even heard of! LOL

graeme_p

9:02 am on Jan 18, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can edit the file using an editor which can open files over ssh. No upload step.

Alternatively ssh in and use an editor in the terminal Nano, vim, Micro....

You can test the config syntax with:

httpd -t


or

apachectl configtest

robzilla

9:23 am on Jan 18, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Apache is not a language per se, so I wouldn't expect any IDE to be able to validate your config.

If you're waiting 30 seconds because it's a busy server, I would recommend you set up a separate development/testing server.

csdude55

6:27 pm on Jan 18, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The other issue is that I wait until after 1am to upload and restart, so that I don't disrupt traffic. But that means I have limited time to work before getting sleepy, so I end up having to spread it all out over days and days :-/

Using httpd -t or configtest might be OK, I'm assuming that I would just need to take the original .conf files and rename them to something without a .conf extension, but Apache would still run as if they were in place until it's actually restarted. Right? If so then it's not the same as an IDE or emulator, but it's better than nothing.

robzilla

9:16 pm on Jan 18, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



so that I don't disrupt traffic

You can do a graceful restart at any time without disrupting traffic.

Apache would still run as if they were in place until it's actually restarted. Right?

Right. Of course, a valid config is not necessarily the same as one that's working as intended.

That's why it can be helpful to have a test environment.

csdude55

10:22 pm on Jan 18, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In order to have a useful test environment, I really need a second server with all of the same scripts and everything. That becomes cost prohibitive :-/

phranque

10:55 pm on Jan 18, 2023 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



if you are testing your configuration directives (you are asking for a "development environment" for your apache server config, correct?), you don't need the entire server environment.
you only need apache and the relevant modules installed.
as soon as apache hands off control to your script (or logs the error for a missing script), your server config testing is done.
your apache config IDE could be a WAMP/MAMP install at practically no additional cost...

lucy24

12:35 am on Jan 19, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



An additional suggestion, if you're not already doing so: designate one obscure directory on one obscure site as a test directory, and set its AllowOverride to allow everything. Not universally applicable, of course, but most directives that can be used in .htaccess can now be tested on the fly in this directory without restarting everything.

csdude55

9:42 pm on Jan 25, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just for future readers, I ended up following @lucy24's suggestion. It's not perfect since data in htaccess doesn't always copy over to Apache config, but at least it helps me eliminate syntax errors without disrupting anything :-)