[TUTORIAL] How to edit your apache.conf file

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.
Blisk
Know my way around
Posts: 143
Joined: Fri Jul 08, 2011 5:54 am

Re: [TUTORIAL] How to edit your apache.conf file

Post by Blisk »

Thank you
User avatar
steve102
Know my way around
Posts: 151
Joined: Sat Dec 20, 2014 2:53 am
Location: Maine
Contact:

Re: [TUTORIAL] How to edit your apache.conf file

Post by steve102 »

Good work!

IMO, fribse is very correct! I also discovered ..
I have to recommend stronly against modifying the apache.conf directly.
Create a config file another place, eg. a share where you can easily reach it, and only include an 'include /share/YOURSHARE/example.conf' in the apache.conf.
Nas1: TS-453D -Firmware: 4.5.3 Build 1652
Nas2: TS-453D -Firmware: 4.5.3 Build 1652
Nas3: TS-253 Pro-Firmware: 4.5.3 Build 1652
Nas4: TS-451+ -Firmware: 4.5.3 Build 1652
Windows 7 | Apple| Linux | Apache | Perl
ethan11james
New here
Posts: 4
Joined: Tue Apr 21, 2015 1:41 pm

Re: [TUTORIAL] How to edit your apache.conf file

Post by ethan11james »

nice posts all steps you covered in the posts so everyone can easily edit apache.conf file if they need thanks for it
madseason41
Starting out
Posts: 37
Joined: Sat Mar 24, 2012 11:15 pm

Re: [TUTORIAL] How to edit your apache.conf file

Post by madseason41 »

I am running FW 4.1.3 on a 219PII and after a reboot my apache.conf file is overwritten. I included a file path to a custom.conf for setting up my reverse proxy. The include line is totally erased after a reboot. I used pwilson's .qpkg mentioned in another thread and put my custom.conf file in the share folder to make it work.

After reading thru threads I was under the impression this behavior was fixed in 4.1.1. Is anyone else seeing this behavior or is it just late and I am messing something up?
TS-219 PII
Serviio/ CouchPot/ Transmission/ Sickbeard
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [TUTORIAL] How to edit your apache.conf file

Post by schumaku »

There should be a massive relief coming with QTS 4.2 - they only protect parameters controlling memory usage, to avoid users doing ***** things.
Kodauk
New here
Posts: 7
Joined: Sun Feb 07, 2016 10:24 am

Re: [TUTORIAL] How to edit your apache.conf file

Post by Kodauk »

my apache.conf get overwritten on every server restart with the latest 4.2.0 firmware. are there any updates on this issue?
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [TUTORIAL] How to edit your apache.conf file

Post by schumaku »

What do you to customize?

As mentioned many times before ... the apache.conf generated is not freely editable or can't be fully replaced.
Kodauk
New here
Posts: 7
Joined: Sun Feb 07, 2016 10:24 am

Re: [TUTORIAL] How to edit your apache.conf file

Post by Kodauk »

i just want to include my custom config file with security enhancements for owncloud like strict transport security headers which works well but sometimes the apache.conf gets overwritten and my include is lost.
https://doc.owncloud.org/server/9.0/adm ... t-security

Another thing i'd like to enable is memcache(d) which is present (mod_cache.so, mod_mem_cache.so) in the apache modules dir but not enabled by default. I've looked around but was not able to get it running and have to look at it later.
rgrasmus
New here
Posts: 4
Joined: Sat Nov 07, 2015 4:53 am

Re: [TUTORIAL] How to edit your apache.conf file

Post by rgrasmus »

Kodauk wrote:i just want to include my custom config file with security enhancements for owncloud like strict transport security headers which works well but sometimes the apache.conf gets overwritten and my include is lost.
I am trying to do the same thing (i.e. default to https for a personal homepage hosted on the NAS). Were you able to figure out how to do this without the edits being overwritten?
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [TUTORIAL] How to edit your apache.conf file

Post by schumaku »

rgrasmus wrote:I am trying to do the same thing (i.e. default to https for a personal homepage hosted on the NAS). Were you able to figure out how to do this without the edits being overwritten?
Assuming you don't need HSTS and instead of re-inventing the wheel - simply define a virtual host for https only.
Mikiya
Getting the hang of things
Posts: 87
Joined: Tue Feb 09, 2016 4:07 pm

Re: [TUTORIAL] How to edit your apache.conf file

Post by Mikiya »

I'm trying to add HSTS too but i cannot succeed :( Does anybody find a way ? Thanks !

edit @schumaku: it's not the same case : in case of MITM attack, the server use https with the attacker proxy but the attacker proxy use http with the client so https only on server does not protect this issue, only "https only on client" protect it (=hsts).
TS-251+ 4Go - RAID 1 Seagate 3To - Eaton 3S 550
User avatar
schumaku
Guru
Posts: 43579
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
Contact:

Re: [TUTORIAL] How to edit your apache.conf file

Post by schumaku »

Mikiya wrote:I'm trying to add HSTS too
No word in this thread on HSTS, except of my exclusion... Trouble is the newer the firmware, the more of the editing is undone on the Web Server restart. In my opinion, QNAP must add HSTS anyway, and should offer much better customisation again.
presenceofmind
Know my way around
Posts: 198
Joined: Thu May 26, 2016 3:05 pm

Re: [TUTORIAL] How to edit your apache.conf file

Post by presenceofmind »

Hi all,

I need to make some changes in the apache.conf but it's not working.

I remote on my qnap via SSH, I edit apache.conf using vi. I add this at the end of the file:

Code: Select all

Include /etc/config/apache/extra/apache-proxy.conf
Afterwards I restart the qnap webserver and I get the following.
* Shutting down Qthttpd services: OK
* Recover apache confiugre <--------- This is resetting the apache.conf, removing proxy modules, my issue
* Starting Qthttpd services: OK
I've noticed that others are facing the same issue. because of this issue I can't do the setup I have planned out for my webserver.

Please help. I'm stuck on this for more than a month.

TS-251+ firmware 4.3.3.0238
presenceofmind
Know my way around
Posts: 198
Joined: Thu May 26, 2016 3:05 pm

Re: [TUTORIAL] How to edit your apache.conf file

Post by presenceofmind »

can I have some assistance?
User avatar
Toxic17
Ask me anything
Posts: 6476
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

Re: [TUTORIAL] How to edit your apache.conf file

Post by Toxic17 »

Install Qapache and edit anything you like without the constraints of QNAPs limited Webserver.

viewtopic.php?f=320&t=110391
Regards Simon

Qnap Downloads
MyQNap.Org Repository
Submit a ticket • QNAP Helpdesk
QNAP Tutorials, User Manuals, FAQs, Downloads, Wiki
When you ask a question, please include the following


NAS: TS-673A QuTS hero h5.1.2.2534 • TS-121 4.3.3.2420 • APC Back-UPS ES 700G
Network: VM Hub3: 500/50 • UniFi UDM Pro: 3.2.9 • UniFi Network Controller: 8.0.28
USW-Aggregation: 6.6.61 • US-16-150W: 6.6.61 • 2x USW Mini Flex 2.0.0 • UniFi AC Pro 6.6.62 • UniFi U6-LR 6.6.62
UniFi Protect: 2.11.21/8TB Skyhawk AI • 3x G3 Instants: 4.69.55 • UniFi G3 Flex: 4.69.55 • UniFi G5 Flex: 4.69.55
Locked

Return to “Web Server & Applications (Apache + PHP + MySQL / SQLite)”