LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Permalinks not working in Apache2 Ubuntu 16.10 (https://www.linuxquestions.org/questions/linux-software-2/permalinks-not-working-in-apache2-ubuntu-16-10-a-4175581260/)

intel1212 06-02-2016 07:05 AM

Permalinks not working in Apache2 Ubuntu 16.10
 
1. The mod_rewrite is enabled
2. I have webmin 18.01 installed
3.using latest apache version 2.4+ then here is the process how to enable mod_rewrite.
4.Open apache2.conf using your favorite text editor.
Change Override dir still no luck
5..htaccess & permalinks in right place

6.all domains are working but sub domains or links not working
404 pages are night mare can get nothing to fix for this on a Ubuntu 16.10
for example.c** this works but not sub links example.c**/blog/ they don t work but
example.c** works be great if some one can sovled this for me

Habitual 06-02-2016 08:03 AM

n/m.

permalinks implies to me, Wordpress.

intel1212 06-02-2016 08:43 AM

links
 
yes your right but its issue with all domains and sub urls they don t work not wordpress but same isuue trying to fix look really hard in it the mod rewite is on? i look on few search engines people haveing same issue but its been sovled on older abuntu but this is new abuntu 16.10 and still can t get it to work sub links ? any one have any clue?

Habitual 06-02-2016 09:00 AM

Quote:

Originally Posted by intel1212 (Post 5554492)
1. The mod_rewrite is enabled
2. I have webmin 18.01 installed
3.using latest apache version 2.4+ then here is the process how to enable mod_rewrite.
4.Open apache2.conf using your favorite text editor.
Change Override dir still no luck

Post the code edit you made.
Did you restart apache2 after the edit?
What version of Wordpress?

What directory is your Wordpress "in" exactly?

intel1212 06-02-2016 09:25 AM

show you config
 
wordpress 4.2.2 and restarted it

PHP Code:

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

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


# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

<Directory /usr/share>
    AllowOverride None
    Require all granted
</Directory>

<Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
#               AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                # RedirectMatch ^/$ /apache2-default/
        </Directory>

<Directory /www/kproxy.pw/>
  RewriteEngine On
  RewriteBase /www/kproxy.pw/
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule . /index.php [L]
</Directory>


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




# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#
AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Require all denied
</FilesMatch>


#
# The following directives define some format nicknames for use with
# a CustomLog directive. 


Habitual 06-02-2016 10:09 AM

Quote:

Originally Posted by intel1212 (Post 5554572)
Code:

<Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
#              AllowOverride None
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
                # RedirectMatch ^/$ /apache2-default/
        </Directory>


Your override is commented out!
Try
Code:

AllowOverride All
without the comment and
Code:

apache2ctl graceful
will restart it.
Test.

intel1212 06-02-2016 11:20 AM

sorry for delay
 
404 not found

The requested URL /network/ was not found on this server.
Apache/2.4.18 (Ubuntu) Server at www.kproxy.pw Port 80

this is issue i am getting trying to think where comming from?any another clues ?

intel1212 06-02-2016 11:28 AM

error.log
 
haveing look at this i have 3 domain names add in webmin but it saying no matching not understand this where is this going wrong in the Apache error.log


PHP Code:

[Thu Jun 02 06:25:20.257520 2016] [mpm_prefork:notice] [pid 13002AH00163Apache/2.4.18 (Ubuntumod_perl/2.0.9 Perl/v5.22.2 configured -- resuming normal operations
[Thu Jun 02 06:25:20.257632 2016] [core:notice] [pid 13002AH00094Command line'/usr/sbin/apache2'
[Thu Jun 02 06:26:04.495107 2016] [log_config:warn] [pid 7649] (28)No space left on device: [client 131.161.9.238:28246AH00646Error writing to /var/log/apache2/other_vhosts_access.log
[Thu Jun 02 07:00:19.337531 2016] [autoindex:error] [pid 7758] [client 89.24.217.236:56480AH01276Cannot serve directory /var/www/hideproxy.co/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htmfound, and server-generated directory index forbidden by Options directive
Failed loading 
/usr/lib/php/20151012/ioncube_loader_lin_5.6.so:  /usr/lib/php/20151012/ioncube_loader_lin_5.6.soundefined symbolzend_hash_del_key_or_index
Failed loading 
/usr/lib/php/20151012/ioncube_loader_lin_5.6.so:  /usr/lib/php/20151012/ioncube_loader_lin_5.6.soundefined symbolzend_hash_del_key_or_index
Failed loading 
/usr/lib/php/20151012/ioncube_loader_lin_5.6.so:  /usr/lib/php/20151012/ioncube_loader_lin_5.6.soundefined symbolzend_hash_del_key_or_index
Failed loading 
/usr/lib/php/20151012/ioncube_loader_lin_5.6.so:  /usr/lib/php/20151012/ioncube_loader_lin_5.6.soundefined symbolzend_hash_del_key_or_index
Failed loading 
/usr/lib/php/20151012/ioncube_loader_lin_5.6.so:  / 


Habitual 06-02-2016 12:55 PM

Code:

Error writing to /var/log/apache2/other_vhosts_access.log
Cannot serve directory /var/www/hideproxy.co/

open a terminal and issue:
Code:

sudo ls -lF /var/log/apache2/other_vhosts_access.log
and show the result.
If it does not exist, make it using:
Code:

sudo touch /var/log/apache2/other_vhosts_access.log
Code:

sudo chown root:adm  /var/log/apache2/other_vhosts_access.log
"Cannot serve directory /var/www/hideproxy.co/"
Did you plan on content being served from /var/www/hideproxy.co/ ?

intel1212 06-02-2016 01:16 PM

reply
 
this is showing so it worked
root root 101225 Jun 2 14:07 /var/log/apache2/other_vhosts_access.log
then i copyright the crwn other_vhosts_access.log

The requested URL /network/ was not found on this server

so this still not soved it so trying to think what else that can be doing this mod rewite not showing any errors
now in public folder .htacsses i did that right still no luck cause doing it on few domains that does not have wordpress installed
i think its permissions in config file can t find it where the issue comming from any another issues ?

intel1212 06-02-2016 01:20 PM

name servers
 
Did you plan on content being served from /var/www/hideproxy.co/ ?

well my domain names pointing to ns1.hideproxy.co and for ns2 on the server ? you think this cause crosswire ?
permissions? i don t think it can be that never heard of that but you can be right trying to think where and how?

intel1212 06-03-2016 03:54 AM

Solved
 
Ok took me over 24 hours to fix this so what sloved this was webmin config and apache config very tricky if you don t know what
are doing so i am going to incorrect this for another users for abuntu 16.10 because lot of permissions have changed in config file

so this what i did
Edit Config Files
1.webmin config file you need to change this for any domain or sub you create

/etc/apache2/sites-enabled/webmin.14644*****.conf
PHP Code:

<VirtualHost 170.227.202.143:80>
DocumentRoot /var/www/**
<Directory "/var/www/**">
allow from all
Options None
Require all granted
</Directory>
ServerAlias **.com *.***.com
</VirtualHost> 

To This
PHP Code:

[PHP]<VirtualHost 170.227.202.143:80>
DocumentRoot /var/www/**
<Directory "/var/www/**">
allow from all
Options All
Require all granted
</Directory>
ServerAlias **.com *.***.com
</VirtualHost> 

[/PHP]

So when your done changeing this go to the

apache config file

/etc/apache2/apache2.conf

change this to
PHP Code:

<Directory /var/www/>
        
AllowOverride None
    
Require all granted

        
</Directory

to this
PHP Code:

<Directory /var/www/>
                
Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow
,deny
                allow from all
 
</Directory

Restart apache2 server on webmin and this should slove your issue well it worked for me.few days self talk looking
down to see where i was going wrong and bang it worked thank you.feel free to ask any ? on this topic closed thank you

Habitual 06-03-2016 05:47 AM

The use of the .htaccess file is disabled in newer versions of apache2.
What the hell is "/var/www/*"
Never seen an asterisk used and may have unforeseen consequences.
Remember, permissions in Linux should be explicit, not implicit.
I'd change that to "/var/www/" as shown is every single example I have ever seen.

Up to you.

I can't tell what's wrong with your domain and/or dns because I don't have a domain name to work with.
and 170.227.202.143 has no rDNS and it's assigned to IBM.

jeenifer36 06-03-2016 05:50 AM

Problem with permalinks
 
Same problem with my website.

intel1212 06-03-2016 06:58 AM

* for example
 
thank you for clear that out

Quote:

The use of the .htaccess file is disabled in newer versions of apache2.
What the hell is "/var/www/example.com"
Never seen an asterisk used and may have unforeseen consequences.
Remember, permissions in Linux should be explicit, not implicit.
I'd change that to "/var/www/" as shown is every single example I have ever seen.

Up to you.

I can't tell what's wrong with your domain and/or dns because I don't have a domain name to work with.
and 170.227.202.143 has no rDNS and it's assigned to IBM.
Quote:

rDNS and it's assigned to IBM. the server has rdns installed working great 100% working
i was trying to clear more on my last post * between means example.com for sub domains and domain names

.htaccess file is disabled in newer versions of apache2. there was nothing out there not in forums i search for hours
this first i know it was down to apache2 .htaccess disabled in newer versions.not in there faq,s nothing
so this down to there abuntu end i think they should fix this for new linux user,s to know in pass


All times are GMT -5. The time now is 02:24 AM.