I would like to install OTRS 5 in a shared hosting environment. I heard, that this is possible but not easy.
Here is what I know so far and what I did:
Webfolder: /var/www/html/
otrs-5.0.23.tar.gz is extraced to /var/www/html/cgi-bin/
Also added /var/www/html/otrs-web
Permissions are set to 755
Config.pm.dist renamed to Config.pm
Created a DB an gave the Informations to Config.pm
Home Path is set to /var/www/html/cgi-bin/
I imported the three mysql SQL Files to te OTRS DB
I renamed the Cronjobs
Links were set ln -s /var/www/html/otrs-web/skins/ /var/www/html/cgi-bin/var/httpd/htdocs/skins
ln -s /var/www/html/otrs-web/js/ /var/www/html/cgi-bin/var/httpd/htdocs/js
After this, I tried to open http://192.168.0.160/otrs-web in the browser. It gets the index.html a it tries to redirect me to http://192.168.0.160/otrs/index.pl but ends with
Not Found
The requested URL /otrs/index.pl was not found on this server.
Apache/2.4.10 (Debian) Server at 192.168.0.160 Port 80
The content of the index.html is:
<html>
<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<meta http-equiv="refresh" content="0; URL=/otrs/index.pl" />
<title>OTRS Redirect</title>
</head>
<body>
</body>
</html>
<!--
index.html - redirect
Copyright (C) 2001-2017 OTRS AG, http://otrs.com/
This software comes with ABSOLUTELY NO WARRANTY. For details, see
the enclosed file COPYING for license information (AGPL). If you
did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
-->
I have to confess, that I am not into this whole redirection stuff. I gues, this might be the problem. If someone do have an Idea or a link to a nice tutorial, I would be happy :)
Related
I'm currently installing a linux webserver for software repositories. So, for testing it, i've change the config file as minimum. Configure permissions on this directory and enable SELinux on it too.
Because i have a dedicated directory, i don't need and don't want to use /var/www.
Here're my portion of config file in /etc/httpd/conf/httpd.conf:
[…]
DocumentRoot "/<new_dir>"
<Directory "/<new_dir>">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory "/<new_dir>">
[…]
SELinux configuration:
semanage fcontext -a -t system_u:object_r:httpd_sys_rw_content_t "/<new_dir>(/.*)?"
Add ACL for apache to be sure that it is running:
setfacl -m u:apache:rw /<new_dir>
Then... restart the service: systemctl restart httpd without error.
In my directory <new_dir>, I'v only repositories files, not index.html file.
When I'm tried to get info, I received content of an index file (but I don't know where it comes from):
# curl http://localhost:80 or (http://localhost)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Index of /</title>
</head>
<body>
<h1>Index of /</h1>
<ul></ul>
</body></html>
And when I tried a directory of repository it, this error appears:
# curl http://localhost:80/mysql or (http://localhost/mysql)
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href= http://localhost/mysql/>here</a>.</p>
</body></html>
I really don't understand where could be the issue...
As far as I know, it is possible to change the default DocumentRoot directory for httpd or isn't it?
No SSL, no virtual host, no special specification just another directory as DocumentRoot.
As anyone an idea, where or what could be the problem?
Thanks in advance and best regards, H.
I am on a Hostinger shared plan, trying to set a CORS header on a single TOML file that MUST reside in the public_html/.well-known folder. I have an .htaccess file in the ".well-known" folder but the Apache server will not process it.
However, if I rename the ".well-known" folder to "well-known" (just removing the period), the .htaccess file works and I can set whatever headers I want for files in that folder.
At this point I have deleted my entire site and replaced it with an extremely simple one in order to try and make this work.
The current file structure is as follows:
public_html
/.well-known
.htaccess
test.toml
/well-known
.htaccess
test.toml
index.html
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Apache Header Test</title>
</head>
<body>
Apache Header Test
</body>
</html>
.htaccess (identical in the ".well-known" and "well-known" folders)
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
test.toml (identical in the ".well-known" and "well-known" folders)
Apache Header Test
When I navigate to /well-known/test.toml, the response is served with the CORS header set and a content-type of "text-plain", and the toml file contents show as plain text in Chrome, which is the desired and expected behavior for both folders.
However when I navigate to /.well-known/test.toml (with the period), there is no CORS header, it shows a content-type of "application/octet-stream", and the toml file downloads instead of showing in the browser.
What exactly is happening here and how can I fix it? Thank you!
After finally asking the right question to Hostinger (thank you MrWhite!), they confirmed that making changes to the /.well-known folder is not possible on a shared hosting plan. Here is the official response I received:
The .well-known directory is server-default, so that is why overriding and making changes to it is not possible on a shared hosting plan, as important data/information is stored there.
To make meaningful changes in this directory, you would need root access, which is only available on our VPS plans.
I've set up a Vagrant LAMP development environment on my Windows 8.1 machine. The guest operating system is Centos 7. I have a subfolder of my main vagrant folder called workspace which I have synced to /var/www/workspace on my guest. I also have port 80 being forwarded to the guest and httpd running with DocumentRoot of /var/www/workspace. When the folder is empty, I get the standard apache test page. Everything is good so far.
I created an index.html file in the workspace folder on my host machine in SublimeText with the following contents.
<html>
Test1
</html>
I checked this in the web browser on my host, and get the expected result
Test1
I continued to edit the index.html file, adding head and body tags and some divs:
<html>
<head>
<title>Test site</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="button">Test1</div>
<div class="button">Test2</div>
</body>
</html>
Then I change the text in the links and add a third div.
<html>
<head>
<title>Test site</title>
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="button">Blog</div>
<div class="button">Resume</div>
<div class="button">Experiments</div>
</body>
</html>
As soon as I add the third div, my browser starts returning a previous version of the file with Test1 and Test2 as the link text. I made sure my browser cache was disabled. I checked in the Network section of the Chrome dev console to make sure that the file was coming from the webserver, which it was. I check in vi on the guest machine, and the index file contains the Blog, Resume, Experiments links. If I modify the file in vi by just adding a new line or anything, it fixes the issue. If I remove the third div, it fixes the issue. If I remove the css reference line, it fixes the issue. I have no idea where this old version is or why it's being returned when certain changes are made. My assumption is that it is a vagrant syncing issue, but I'm open to any ideas on what else might be going wrong.
I've found an answer to my problem although not an ideal one. It appears this is an issue with VirtualBox, not Vagrant. More information about this issue can be found here:
Ticket 9069
Ticket 819
There is no solution, but there is a proposed workaround to avoid this issue. The workaround is to add this to your httpd.conf:
EnableSendfile off
EnableMMAP Off
I've got an Apache server, and I'd like to set it up such that when a directory is requested that does not have an index.html file (and thus, Apache would, by default, generate a directory listing), Apache instead redirects (ideally using HTTP code 303) to a given url.
Unless absolutely necessary, I'd like to stay away from going outside Apache (for example, by having Apache load a php script which writes the headers manually). This is an otherwise static site, and I'd like to avoid having to introduce scripting languages into the mix.
Also, note that this post doesn't solve my problem since all of the proposed solutions use external scripts.
So I figured out that by using a combination of HTML meta refreshing and JavaScript redirection, I could cover almost all browsers in use and still have a static file. So what I did was this. In the apache site config, I put a directive that told apache to first look for index.html files, and if that failed, use a site-wide /no-index.html:
<Directory /path/to/web/root>
DirectoryIndex index.html /no-index.html
</Directory>
no-index.html, then, contained the following:
<html>
<head>
<meta http-equiv="refresh" content="0; url=/">
<script type="text/javascript">
window.location = "/";
</script>
</head>
</html>
(in this example it redirects to the web root, /, but you could replace that with whatever url you wanted)
See here for an explanation of what the <meta> tag is doing.
I've learned that the way to add favicon for a web page is to have the following lines in the page.
<link rel="SHORTCUT ICON" type="image/x-icon" href="http://mysite.com/faviconfilename.ico"/>
<link rel="icon" type="image/x-icon" href="http://mysite.com/faviconfilename.ico" />
Should i add this code in each and every page my site has?? I use Apache - tomcat clustering to serve pages. Is there any other easy way to do this?
It is usually enough to place a file called "favicon.ico" in the root of your website.
You can get rid of the unnecessary processing and traffic as well as the error log entries by using the following Apache configuration incantations:
# Don't bother looking for favicon.ico
Redirect 404 /favicon.ico
# Send custom text instead of sending the custom error page
<Location /favicon.ico>
ErrorDocument 404 "No favicon"
</Location>
Modify the apache config.
upload this file to the root directory of your website. Make sure that it is readable so that apache can read it. If you have shell access, type: "chmod +r favicon.ico".
Then edit httpd.conf and insert the following line:
"AddType image/x-icon .ico"
Your approach works when you don't have access to your apache config. In this case, if you are using any framework then you should add it to your layout/template.
Here is my method for php sites. It ensures that if you update the favicon, it will be updated immediatly when your clients visit your site:
<link rel="shortcut icon" href="favicon.ico?v=<?php echo time() ?>" />