0

ubuntu 14.04 and Server version: Apache/2.4.16 (Ubuntu)

The redirect rule is not working or am i missing something ? when i type in the browser, i want to use https:teampass.domain.org but instead https://teampass.domain.org/teampass is the only url that works. Am i missiong something? how can i get to use https://teampass.domain.org

more /etc/hosts

 127.0.0.1       localhost
 127.0.1.1       teampass
 192.*.*.*   teampass       teampass.domain.org

# The following lines are desirable for IPv6 capable hosts
 ::1     localhost ip6-localhost ip6-loopback
 ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

More /etc/apache2/apache2.conf

  ServerRoot "/etc/apache2"

 Mutex file:${APACHE_LOCK_DIR} default

 PidFile ${APACHE_PID_FILE}

 Timeout 300


  KeepAlive On

  MaxKeepAliveRequests 100

  KeepAliveTimeout 15


# These need to be set in /etc/apache2/envvars
 User ${APACHE_RUN_USER}
 Group ${APACHE_RUN_GROUP}

  HostnameLookups Off

  ErrorLog ${APACHE_LOG_DIR}/error.log


   LogLevel warn

 # Include module configuration:
 IncludeOptional mods-enabled/*.load

 IncludeOptional mods-enabled/*.conf

  # Include list of ports to listen on
  Include ports.conf


    <Directory />

    Options FollowSymLinks

    AllowOverride None

    Require all denied

   </Directory>


  <Directory /usr/share>

    AllowOverride None

    Require all granted

   </Directory>

   <Directory /var/www/html>
    Options Indexes FollowSymLinks
    AllowOverride ALL
    Require all granted
   </Directory>

   <Directory /srv/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
     </Directory>


  AccessFileName .htaccess


  <FilesMatch "^\.ht">
    Require all denied
   </FilesMatch>



 # Include generic snippets of statements
 IncludeOptional conf-enabled/*.conf

  # Include the virtual host configurations:
   IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

# phpMyAdmin Configuration
 Include /etc/phpmyadmin/apache.conf

 #load ssl module
 #LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so

more /etc/apache2/sites-enabled/default-ssl.conf

 <VirtualHost *:443>
    ServerAdmin webmaster@localhost
    ServerName teampass.domain.org
    Serveralias www.teampass.domain.org
    DocumentRoot /var/www/html

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
    SSLEngine on

    SSLCACertificateFile /etc/apache2/ssl/DigiCertCA
    SSLCertificateFile /etc/apache2/ssl/star_domain_org
    SSLCertificateKeyfile /etc/apache2/ssl/teampass.key
</VirtualHost>

more /etc/apache2/sites-enabled/teampass.conf

 <VirtualHost *:80>
  ServerName teampass
  Redirect permanent /  https://teampass.domain.org/

  ServerAdmin webmaster@localhost
  ServerAlias www.teampass.domain.org
  DocumentRoot /var/www/html/teampass
  <Directory /var/www/html>
        AllowOverride All
    </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
    <IfModule mod_rewrite.c>
            # DO NOT REMOVE
            RewriteOptions Inherit
    </IfModule>
   </VirtualHost>


   <VirtualHost *:443>
    ServerAdmin webmaster@localhost
    ServerName teampass.
    #ServerAlias www.teampass.domain.org
    DocumentRoot /var/www/html/teampass

    SSLCertificateFile /etc/apache2/ssl/star_domain_org
    SSLCertificateKeyfile /etc/apache2/ssl/teampass.key
    SSLCACertificateFile /etc/apache2/ssl/DigiCertCA
    SSLEngine on
    ErrorLog ${APACHE_LOG_DIR}/teampass_error.log
    CustomLog ${APACHE_LOG_DIR}/teampass_access.log combined

    <IfModule mod_rewrite.c>
            # DO NOT REMOVE
           RewriteOptions Inherit
    </IfModule>
    </VirtualHost>

responding to .htaccess

opt is where the mail teampass package is stored. /var/www/html has the link

teampass in html

root@teampass:~# find / -name .htaccess

 /opt/TeamPass-2.1.23/includes/avatars/.htaccess

 /opt/TeamPass-2.1.23/upload/.htaccess

more /opt/TeamPass-2.1.23/includes/avatars/.htaccess

 AddHandler cgi-script .php .php3 .php4 .phtml .pl .py .jsp .asp .htm .shtml     
 .sh .cgi

 Options -ExecCGI

more /opt/TeamPass-2.1.23/upload/.htaccess

AddHandler cgi-script .php .php3 .php4 .phtml .pl .py .jsp .asp .htm .shtml       

  .sh .cgi

 Options -ExecCGI

 RewriteEngine On
  • 1
    Your edits to /etc/hosts only affect the local machine, and not requests from other hosts. Are you sure you're doing what you think you're doing? – DopeGhoti Nov 30 '15 at 18:26
  • @DopeGhoti I put the ip of the localhost to resolve teampass. – Lolu911 Nov 30 '15 at 18:42
  • Do you want the actual content to be presented as teampass.domain.org or as teampass.domain.org/teampass ? – roaima Nov 30 '15 at 19:00
  • as teampass.domain.org – Lolu911 Nov 30 '15 at 19:03
0

In your teampass.conf file change the DocumentRoot line to read

DocumentRoot /var/www/html/teampass/teampass

for both virtual hosts

  • thanks for the help but teampass is on html so DocumentRoot should be /var/www/html/ or /var/www/html/teampass – Lolu911 Nov 30 '15 at 18:40
  • If the actual html files are located in /var/www/html/teampass and you still have to use teampass.domain.com/teampass to access them then you must have another rewrite rule somewhere that we're not seeing. Otherwise the content would be available at teampass.domain.com. Are there any .htaccess files in the teampass directory? – David King Nov 30 '15 at 18:42
  • re-edited the file above to respond to your comment. – Lolu911 Nov 30 '15 at 18:52
  • How does /opt get pulled into this? – David King Nov 30 '15 at 18:53
  • /opt hold the actual teampass package. html in /var/www holds a symbolik link called teampass. – Lolu911 Nov 30 '15 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.