[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: 101
Joined: Fri Jul 08, 2011 5:54 am

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

Post by Blisk » Tue Jul 22, 2014 1:57 pm

Thank you

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

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

Post by steve102 » Fri Mar 27, 2015 5:52 pm

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-419+Pro -Firmware: 3.7.1 Build 20120615
Nas2: TS-253 Pro (Pre configured at purchase) -Firmware: 4.1.3 Build 20150217
Currently installed Perl Developer Tools 5.10.0.2
Windows 7 | Apple| Linux | Apache | Perl
Nas3: TS-451+ -Firmware: 4.2.2 Build 20161214

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 » Wed May 06, 2015 6:28 pm

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 » Wed May 20, 2015 12:15 pm

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: 43672
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 » Mon Jun 15, 2015 1:37 pm

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 » Sat Mar 19, 2016 8:09 am

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: 43672
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 » Wed Mar 23, 2016 5:22 am

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 » Wed Mar 23, 2016 7:33 pm

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 » Sun Jul 10, 2016 4:00 am

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: 43672
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 » Mon Jul 11, 2016 5:42 pm

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: 85
Joined: Tue Feb 09, 2016 4:07 pm

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

Post by Mikiya » Wed Jan 25, 2017 9:22 pm

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: 43672
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 » Sat Feb 04, 2017 4:33 am

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: 138
Joined: Thu May 26, 2016 3:05 pm

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

Post by presenceofmind » Fri Jul 21, 2017 12:45 am

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: 138
Joined: Thu May 26, 2016 3:05 pm

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

Post by presenceofmind » Fri Jul 28, 2017 4:44 pm

can I have some assistance?

User avatar
Toxic17
Ask me anything
Posts: 5112
Joined: Tue Jan 25, 2011 11:41 pm
Location: Planet Earth
Contact:

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

Post by Toxic17 » Fri Jul 28, 2017 5:29 pm

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

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

QTS 4.x User Guidex

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


NAS: TS-473-32GB QM2-2P QXG-10G1T 4.3.6.0993 • TVS-463-16GB 4.3.6.0993 QM2-2S10G1TB • TS-459 Pro 2GB 4.2.6 • TS-121 4.3.3.0998 • APC Back-UPS ES 700G •
QPKG's: TwonkyServer 8.51 • Apache73 • QSonarr 3.0.1.503 • QNBZGet 21.0 • phpMyAdmin 4.9.0.1 • Qmono 5.20.1.19 • McAfee 2.2.1 • Lychee 3.2.15 • HBS 3.0.190802 • LEgo v3.0.0
Network: VM Hub 3.0 <500/35> • UniFi USG Pro 4 • UniFi USW-16-150W • UniFi USW-8-60W • UniFi CloudKey Gen2+• UniFi G3-Flex • UAP AC Pro • UAP AC Lite • SLM2008 • Dell 7050 MFF •

Locked

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