Trouble Setting Up Basic User Authentication On Apache2 Web Server

Hey guys!

So I decided to set up some basic user authentication on my apache2 server, and I am running into some problems. I followed the documentation provided by apache on their website, but I cant create the password file for some reason. I did a little trouble shooting myself, and found out that I need to use htpasswd2.1 as opposed to htpasswd(which is nowhere to be found).

The specific part I am stuck with, is running this command:

htpasswd2.1 -c /opt/apache2/passwords user1

It's displaying htpasswd2.1: command not found.

I am completely stuck, and seeking assistance. Thanks in advance for taking the time to review this.


Similar Content



Apache2 Won't Start

When I type

service apache2 start

I get a message saying:

[....] Starting web server: apache2apache2: Syntax error on line 7 of /etc/apache2/apache2.conf: Could not open configuration file /etc/init.d/apache.conf: No such file or directory
Action 'start' failed.
The Apache error log may have more information.
failed!

The apache error log is blank and doesn't have any information.
Please help me.

Zoneminder URL Can't Be Found By Apache2

Having tried several posts on this issue and browsing numerous conf files I am at a loss... Any suggestions beyond the reload, and apache to apache2 ln's?

Apache2 is working, I get the default page when attempting to log in via browser... Apache (not2) config does not seem to be present, I get an error when trying ln.

I can't seem to find the zm html pages and don't really understand some of the more sophisticated ways to direct to pages and scripts...

Not sure where to go next, maybe Apache manuals?

I's sure this is in the wrong place but as a newwwbie, I thought I'd throw it in here as an intro...

Setting Up Apache2 Virtual Host - Getting URL Not Found Error

Trying to set up Virtual Host on Ubuntu 14.04.

Any help to solve this is greatly appreciated!!!

Here is info:

Directory: /var/www/mydb.com/public_html (owner set to $USER:$USER)

Permissions: sudo chmod -R 755 /var/www/

Sample Page: /var/www/mydb.com/public_html/index.html (Shows Message)

Virtual Host Files:

Sites Available: mydb.com.conf
set ServerAdmin => admin@mydb.com
set ServerName => mydb.com
set ServerAlias => www.mydb.com
set DocumentRoot => /var/www/mydb.com/public_html

Sites Enabled: mydb.com.conf
ServerName mydb.com
ServerAlias www.mydb.com
ServerAdmin admin@mydb.com
DocumentRoot /var/www/mydb.com/public_html


I: disabled 000-default.conf w/a2dissite
enabled mydb.com.conf w/a2ensite

HOSTS File /etc/hosts:

127.0.1.1 localhost mydb.com
127.0.0.1 localhost
127.0.1.1 rick-Latitude-E6510

Result of localhost/mydb.com Same with www.mydb.com.

404 Not Found.
The requested URL /mydb.com was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80

This from /var/log/apache2/access.log

127.0.0.1 - - [03/Apr/2015:13:19:08 -0700] "GET /mydb.com HTTP/1.1" 404 496 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0"

How To Add User Authentication In Linux Server And Windows Client

Hello Guys,

I am an newbie, just started with linux, I have installed centos 6.6 and learning it. But I got stuck in some user controls,

Now In my company I wanted to have an Linux Server and need to do the user authentication and wanted to create domain, But also wanted that my Client OS would be MAC and Windows..

Can anybody Help ??




Please reply here or in my email :- Yerunkar11@gmail.com

Once again thanks Again for reading, really appreciated

I Have Ubuntu Server (14.10) And I Want To Use Internet

hello, I changed ubuntu 11 to ubuntu 14.10.

At the time of installation, I chose only open ssh for installation and I installed successfully.
now, I have not apache2, because when I typed
Code:
 sudo apt-get install apache2

I see:
Code:
Unable to locate package apache2


It is clear I have not apache2.now,I want to connect in internet and install it.

thanks.

Authentication Errors (publickey,gssapi-with-mic,password)

Hi guys,
I have a problem using scp within following verbose statements:

debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
user@remote_machine1IP's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
debug1: Sending command: scp -v httpd_ip_change2.conf. user2@remote_machine2IP:/usr/local/apache/conf
Executing: program /usr/bin/ssh host remote_machine2IP, user user2, command scp -v -t /usr/local/apache/conf
OpenSSH_4.3p2, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Applying options for *
debug1: Connecting to remote_machine2IP [remote_machine2IP] port 44.
debug1: Connection established.
debug1: identity file /home/user1/.ssh/identity type -1
debug1: identity file /home/user1/.ssh/id_rsa type 1
debug1: identity file /home/user1/.ssh/id_dsa type -1
debug1: loaded 3 keys
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'remote_machine2IP' is known and matches the RSA host key.
debug1: Found key in /home/user1/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received


debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/user1/.ssh/identity
debug1: Offering public key: /home/user1/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /home/user1/.ssh/id_dsa
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
Permission denied, please try again.
debug1: read_passphrase: can't open /dev/tty: No such device or address
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: No more authentication methods to try.
Permission denied (publickey,gssapi-with-mic,password).
lost connection
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.1 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 1

I have been trying to copy files between two remote machines. (RHEL 5.7 on Windows by Mremote).

Thank you !

Can't Locate Bootable Vector Linux Live Default Root Password

I just booted my PC in Vector Linux 7.0 Standard Live Edition. It is a bootable version of Linux that requires no installation. I am currently booting of a DVD-RW. The problem I am running into is the default password for root has already been set. It didn't prompt me to create a user or password at any point. In fact the first time I booted it all that happened was the Operating System loaded up. All I have done since them is run a portable netbeans and try to access the hard drive. When I tried to access the hard drive I got the following error.

Authentication is required to mount the device
An application is attempting to perform an action that requires privileges. Authentication as the super user is required to perform this action.
Password for root: _______???______

I found a few password suggestions on forms like root and vector, but these didn't work. If you would like to experiment with the OS burn it to DVD. See if you can figure out the solution to the problem. Here is the download link: http://vectorlinux.com/downloads

Ldap User Authentication For Samba Share

- I have samba server and ldap server both on different machine. I want to authenticate all the ldap user on samba share to giving access permission for user's on share. I have refer too many document for that but I am unable to access share with ldap user's username and password. I have referred below link

https://wiki.samba.org/index.php/Samba_&_LDAP

http://www.unixmen.com/setup-samba-d...-ubuntu-13-04/

How to troubleshoot for user authentication on samba share?

Permission Problems

trying to set up a simple NAS using Raspian on RaspberryPi2.
installed ntfs-3g and samba.
followed various methods to set it up.
found one that allows me access to my drives.
PROBLEM.....

As a test I edited a simple text file using my laptop (windows7), however when trying to save I receive "access denied"
same occurred on our other computers.

My setup....
in fstab

added...
UUID=DBE6-7AC0 /media/Lexar vfat defaults.noatime 0 2
UUID=F21843B31843756F /media/OurFiles ntfs defaults,noatime0 3


in samba config set security = user and encrypt passwords = yes in Authentication Section, then added the following at the end of file:
[Lexar]
comment this is the Lexar (vfat)
path = /media/Lexar
available = yes
read only = no
browsable = yes
public = yes
writable = yes
create mask = 0775

[OurFiles]
comment this is the OurFiles (ntfs)
path = /media/OurFiles
available = yes
read only = no
browsable = yes
public = yes
writable = yes
create mask = 0775

I would be very grateful for any assistance....thank you

Having trouble mastering this environment, please bear with me,

Apache Not Working Properly After Update To Debian 8

Hi,
I just upgraded my server from Debian 7 to Debian 8. Everything seemed to go fine. However, Apache doesn't seem to be able to see the web files. If I go to my server's IP, I get an empty directory listing, as if the document root was pointed to an empty directory. However, my apache.conf points to /var/www, and there are indeed files the
Code:
root@maples-server:~# ls -la /var/www/
total 624
drwxr-xr-x  5 www-data www-data   4096 Apr 28 19:35 .
drwxr-xr-x 13 root     root       4096 Mar 28 11:43 ..
lrwxrwxrwx  1 www-data www-data     18 Jan 10 20:47 anthony -> /home/anthony/web/
-rw-------  1 www-data www-data   1455 Apr 23 21:41 .bash_history
-rw-r--r--  1 www-data www-data   3388 Jan 21 19:34 .bashrc
drwxr-xr-x 11 www-data www-data   4096 Apr 23 21:41 chat
lrwxrwxrwx  1 www-data www-data     14 Mar 23 16:20 dad -> /home/dad/web/
drwxr-xr-x  2 root     root       4096 Mar 15 05:52 html
-rw-r--r--  1 www-data www-data    323 Mar 26 18:35 index.htm
drwx------  2 www-data www-data   4096 Jan 21 19:50 Mail
-rw-r--r--  1 anthony  anthony  592795 Apr 23 19:52 phpfreechat-1.7.tar.gz
-rw-r--r--  1 www-data www-data     41 Apr 15 21:52 robots.txt
-rw-------  1 www-data www-data   1541 Apr 23 21:41 .viminfo

Here's my apache.conf (with the comments stripped; there were no "end of line" comments):

Code:
root@maples-server:~# cat /etc/apache2/apache2.conf | grep -v "#"

Mutex file:${APACHE_LOCK_DIR} default

PidFile ${APACHE_PID_FILE}

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 5


User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf

Include ports.conf


<Directory />
	Options FollowSymLinks
	AllowOverride None
	Require all denied
</Directory>

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

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

AccessFileName .htaccess

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


LogFormat "v:p h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent


IncludeOptional conf-enabled/*.conf

IncludeOptional sites-enabled/*.conf

I also checked sites-enabled/000-default, and everything seems to be fine the
Code:
root@maples-server:~# cat /etc/apache2/sites-enabled/000-default 
<VirtualHost *:80>

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

	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
	<Directory "/usr/lib/cgi-bin">
		AllowOverride All
		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
		Order allow,deny
		Allow from all
	</Directory>

	ErrorLog ${APACHE_LOG_DIR}/error.log

	# Possible values include: debug, info, notice, warn, error, crit,
	# alert, emerg.
	LogLevel warn

	CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Additionally, the connections are no longer showing up in /var/log/apache2/access.log. The last access time in that file is from before the update. I don't know enough about systemd to know if it is responsible for redirecting the logs to somewhere else...

At this point, I have no idea why it's not working. If anyone could point me in the right direction, I would really appreciate it.
Thanks!

EDIT: After looking around some more, it seems that the output of "apachectl -S" is helpful. So here it is:
Code:
root@maples-server:~# apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl 
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
Define: ENABLE_USR_LIB_CGI_BIN
User: name="www-data" id=33
Group: name="www-data" id=33

It appears that it's looking in a subdirectory html, which was not the case previously (before the upgrade). I've currently got a (ugly but useable) work-around using a symlink:
Code:
root@maples-server:~# cd /var/www/
root@maples-server:/var/www# rm -r html/
root@maples-server:/var/www# ln -s /var/www/
root@maples-server:/var/www# mv www html
root@maples-server:/var/www# ls -l html
lrwxrwxrwx 1 root root 9 Apr 28 22:36 html -> /var/www/

While this does work, I'd like to find the proper way of doing it. Any ideas?