Modrewrite issues apache

How do I make permanent changes to /etc/httpd/conf/httpd.conf

It says do not edit this file… However when i edit the file and making the correct changes for some reason things work…

Then like pure magic the file gets regenerated on me then i get to start over from scratch…

So whats the correct way for me to edit this file… maybe i should take the ability for this file to be modified away idk…

The problem is mainly wordpress related issues…

You can create a custom template, or a custom template fragment. For instance:

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf.d/
vi /etc/e-smith/templates-custom/etc/httpd/conf.d/wordpress.conf

The content of the custom template fragment will be included in /etc/httpd/conf/httpd.conf

I’d like to highlight that in NethServer 7 httpd.conf is no longer a templated file.

is there any technical reason to do so?

I’d understand no templating for virtualhosts, but I can’t see any reason for other global settings

everytime something is untemplated, you loose the possibility to replicate it on other servers, or to restore it and, finally, you need to know how a conf file is… IOW, you need how to edit a httpd.conf file to change a value… it seems to me something wrong and strange in an all web driven distro

Fun…a lot of change will be need in existent modules ?

Ok does some one want to share how to make this template in httpd.conf or be willing to write it out for me before i force feed httpd.conf with crontab every 5 minutes over writing the file and restarting apache?

<Directory />
    Options FollowSymLinks
    AllowOverride all

<Directory "/var/www/vhost/">
    Options Indexes FollowSymLinks
    AllowOverride all
    Order allow,deny
    Allow from all

The above is an example of what i need for all my sites…

Now about Nethserver 7… Yea… It would help if could even get the thing installed hi hi… Some joke their… I spent about a week messing around with the thing and no result in fact thats what caused me to go back to 6.8… First issue I had with Nethserver 7 was rc.local was a disaster. I could not add my special gateway commands to rc.local meaing my server would not boot up with its proper Ip… Nothing in the networking configs even seemed to remotely work with my situation… The following below is only an example of ips but its to help you understand a little bit about what i have to deal with in the Data Center environment…

Lets say my static ip is ok lets say the default gateway is yea some pretty crazy stuff but are you guys following where the problem lies…

So because the networking.conf file wont force me to my proper ip and for some reason it requires a default gateway I can’t just leave it blank this causes issues with the server even being recognizable at all…

Here is an example script i use to help me get things online with nethserver 6.8 I put this in rc.local however it doesn’t stick either…

Example ips only listed

  sleep 8s
    ifconfig eth1 netmask
    sleep 2s
    route add dev eth1
    route add default gw eth1

At least with nethserver 6.8 it will allow cron to run this some times after boot other times i am not sure why it fails… But in Nethserver 7 its like big issue…

So… How do i write templates again?? cant I just copy and past the stuff and make it act like a template??

Would it be easier to maybe make the file read only??

Here is what i am trying at the moment… I imagine this will make some thing back end not happy but the script to write to files is kinda messed up unless your going to allow a web front end where i can insert the proper information need for things to work…

Here is what i did…

    chmod 555 /etc/rc.local
    chmod 555 /etc/httpd/conf./httpd.conf

I hope i don’t get to witness an explosion so far i have been able to go 20 days with out a restart lol…

I just need my crap to work… thats all…

This is some clues…sorry to not be more talkative but i’m at a wedding :smiley:

Its ok have fun at the wedding give me a shout when you get done…

Vale claro que si


Yes you will need a couple of adjustment.
I’m on holiday right now, but I will gladly help you converting an old package next week.

1 Like


You seem to know centos, but you have some lack on neth server, therefore you should take a look to the developer or the administrator manual to understand the e-smith layer

Some reading more Explaining e-smith layer - learning by doing

You have also a little howto i did sometime ago

In fact neth keeps some variables in its database and uses them to write a configuration file like the http.conf…so you cannot overwritten it like you found yourself.

The best…or the easy you can do here is to drop a file in /etc/httpd/conf.d/ with the configuration needed.

Not tested since i write this on my smartphone, but it should work.

1 Like


Taking a quick look, in fact the specific templates have been moved to /etc/httpd/conf.d/nethserver.conf

The difference is that now the default httpd.conf of apache is kept unmodified.

1 Like

thank you mate…

does it mean that I can override everything I have in standard httpd.conf using nethserver.conf?


In fact the template in /etc/http/conf/httpd.conf have been moved to /etc/httpd/conf.d/nethserver.conf

So if you want to modify something it is the way to go.

Of course only for ns7