Run a command as remote user ID in a web server - apache

I have a web application running on Tomcat7 and apache Httpd server. I have a use case to run a command as remote or client user on the web server whose user account is different from remote user accounts. Currently I am handing this requirement by running web server as root user and allowing root user to sudo as remote user for executing the commands on server side.
Please let me know if you have any better and secure ways to handle this.
Thanks.

Related

Connecting to SQL Server on same domain, but getting "Untrusted Domain" error?

We have multiple IIS web applications running on multiple web servers that connect to a SQL Server on a separate machine on the same domain.
Everything was running smoothly for over a year, then we had some major network issues. There was a problem with the replication between the primary and secondary domain controllers. There was an issue with Distributed File System services, Event ID 14530 ("DFS could not access its private data from the Active Directory.").
We got the network issues sorted out apparently, except now, none of the IIS web applications can connect to the SQL Server. We are using Windows Authentication. The error message is "Login failed. The login is from an untrusted domain and cannot be used with Windows authentication." This is weird because we have verified that both the web servers and the SQL Server are in fact on the domain.
To make things weirder, the Network Admin removed the SQL Server from the domain and rejoined it, and the websites worked again... but only for a few minutes. Then the same error started occurring again!
The Network Admin and I have been working on this issue for several days. Any ideas would be appreciated.
Edit:
We can connect using SSMS. Also, applications that do not use IIS can connect. For example, we have a developer with some Fox and Cloud applications that use connection strings that can connect.
We have tried removing and re-adding the web servers to the domain.
The errors in the SQL Server log are as follows:
Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.
Error: 18452, Severity: 14, State: 1.
SSPI handshake failed with error code 0x80090311 while establishing a connection with integrated security; the connection has been closed.
Error: 17806, Severity: 20, State: 2.
Edit 2:
The system log on one of the web servers contained this error this morning:
This computer could not authenticate with [domain controller], a Windows domain controller for domain [domain name], and therefore this computer might deny logon requests. This inability to authenticate might be caused by another computer on the same network using the same name or the password for this computer account is not recognized. If this message appears again, contact your system administrator.
Edit 3:
I have tried pretty much everything suggested in this thread, including making sure the user was not locked out, the password was not expired, and the hosts file did not contain an invalid entry for localhost.

Cannot access apache via external URL, only via remote desktop connection to server

I have a Windows 2012 Server via VPS hosting.
I installed IIS and MySQL last week.
I have no way to remotely access the MySQL db, so thought I'd try to set things up so that I can access it remotely.
I have installed XAMPP this evening, and installed Apache and PHP onto the server.
My domain name. e.g. mysite.com is linked to the VPS hosting, so that I can go to e.g. localhost/index.html and also mysite.com/index.html and see the same page.
I had to configure apache so that I could connect to it at the same time as running IIS, so access it via localhost:8080/phpMyAdmin/index.php. When connected via remote desktop connection, I can also access that via mysite.com:8080/phpMyAdmin/index.php.
However, if I disconnect the remote desktop connection and try again to get to mysite.com:8080/phpMyAdmin/index.php I get a timeout error.
I seem to only be able to access that URL when on the actual server that the site runs from, even though I can use the full external URL.
I wondered if there any way around this?

One-Click Web Deploy failing: "This method is not supported by this class."

I've found a lot of articles on web deploy and why it might fail, but not any with answers with this error message.
Web deployment task failed. (Could not complete the request to remote agent URL https://myserver:8172/msdeploy.axd?site=mysite.)
Could not complete the request to remote agent URL https://myserver:8172/msdeploy.axd?site=mysitename. The request was aborted: The request was canceled. This method is not supported by this class.
I am trying to deploy an MVC4 website from Visual Studio 2013 Express to a Windows 2008 R2 Datacenter server with the Web Server role installed.
I followed this (and other installation guides) and can confirm the following:
Windows Server 2008 R2 Datacenter
Web Server role installed
Management Services is running
Accepting windows and IIS credentials
Server Administrator has permissions
Remote connections enabled (and service restarted)
SSL certificate is our real one, not the self-cert
My firewall is configured to allow this traffic
I am prompted for a username/password when accessing https://myserver:8172/msdeploy.axd
The website is running
Bound to all IPs on :80 and :443 (with same cert as deploy)
So for some reason, it didn't want the Windows Administrator account doing a deploy.
Created an IIS user in IIS Manager User
Changed the permission settings to Windows credentials or IIS manager credentials
Restarted Management Service
Added the newly created user to the website
it works!

MSSQL wont accept connection from website on other host

Iam using SQL server 2000 SP4 and iam running a website on localhost.
This worked great, i moved to hostgator to run my websites there.
I changed the IP in inc.config.php but i still get an error when i visit my website.
Core-Error: Failed to connect to database!
Error: Please check if MSSQL-service is running and reachable (firewall, etc.).
I added firewall rules for the ports that are needed and also added sqlserv.exe to the firewall to allow this. The service is up because my client can still connect to my local hosted website.
Do i need to enable remote connection from MSSQL 2000 ?
http://webtest.demoniz.com

Login SQL from another domain

I am trying to connect to SQL Server 2012 on a separate domain to Visual Studio/ my computer. (It’s my personal machine on a workgroup).
I have access to the server and can log in fine with SQL authentication but want to log on via Windows Authentication. When I try I get the following error:
The login is from an untrusted domain and cannot be used with Windows Authentication.
This is on the data connection of Visual Studio- nothing to do with any code.
How do I make the domain trusted (without login via AD on my machine) or get around this issue?
I tried using Control Panel credential manager but with no luck.
Thank You
That is a setting on the domain controller, not on your computer. The domain the SQL Server is in needs to trust the domain you are login in from. As you have a workgroup computer, that domain would be just your computer.
Talk to your domain admin to see if they can make that happen.
I managed to solve it by running the following command from the same folder as the software:
runas /netonly /user:<Username and Domain> <name of exe>