Sign in to follow this  
swamy

cod4x server ubuntu

Recommended Posts

the question is how can I start cod4x server and stop why unneeded

I placed all game files and cod4x server-Linux files in folder 

/home/cod4 folder

how do I start 

server

I success fully created cod4 server and b3 in windows with the help of cod4x members ... now I was trying it in Ubuntu server 

[ I am completely new to Linux environment]

thanks

Edited by swamy

Share this post


Link to post
Share on other sites

build-essential is already the newest version.

g++-multilib is already the newest version.

gcc-multilib is already the newest version.

nasm:i386 is already the newest version.

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

10 minutes ago, swamy said:

Now compile the server by running make.

O.o

Share this post


Link to post
Share on other sites
29 minutes ago, swamy said:

build-essential is already the newest version.

g++-multilib is already the newest version.

gcc-multilib is already the newest version.

nasm:i386 is already the newest version.

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

O.o

https://cod4x.me/

already has a compiled version  why not start from there?

Share this post


Link to post
Share on other sites

 cod4x18_dedrun

general.cfg

libstdc++.so.6

steam_api.so

cod4.sh

cod4x_server-linux.zip

libgcc_s.so.1

steamclient.so

main [folder] 2.45 gb

usermaps [folder]

zone [folder] 2.45 gb 

here are the files and folders in my /home/cod4/ directory

 

how do I start server now

 

Edited by swamy

Share this post


Link to post
Share on other sites
11 hours ago, swamy said:

 cod4x18_dedrun

general.cfg

libstdc++.so.6

steam_api.so

cod4.sh

cod4x_server-linux.zip

libgcc_s.so.1

steamclient.so

main [folder] 2.45 gb

usermaps [folder]

zone [folder] 2.45 gb 

here are the files and folders in my /home/cod4/ directory

 

how do I start server now

 

Start with this command: sh ./cod4.sh or

./cod4.sh

ofc you must first edit cod4.sh with your server ip,port,rcon password.

Edited by blowoff

Share this post


Link to post
Share on other sites

#!/bin/bash

screen -dmS cod4 ./cod4x18_dedrun +set dedicated 2 +set net_ip 35.200.163.161 +set net_port 28960 +set sv_hostname new ubuntu server  +map mp_backlot

is this correct?

edited this cod4.sh 

 

Share this post


Link to post
Share on other sites

after I edited this cod4.sh file .. 

I did command ./cod4.sh and nothing happen

and I tried checking for open ports and there is no ports open (28960 , 20800 ,20810)

Quote

 

but I did opened this ports using iptables

with this command

-A INPUT -p udp --dport 28960 -j ACCEPT
-A INPUT -p udp --sport 28960 -j ACCEPT
-A INPUT -p tcp --dport 28960 -j ACCEPT
-A INPUT -p tcp --sport 28960 -j ACCEPT
-A INPUT -p udp --dport 20800 -j ACCEPT
-A INPUT -p udp --sport 20800 -j ACCEPT
-A INPUT -p tcp --dport 20800 -j ACCEPT
-A INPUT -p tcp --sport 20800 -j ACCEPT
-A INPUT -p udp --dport 20810 -j ACCEPT
-A INPUT -p udp --sport 20810 -j ACCEPT
-A INPUT -p tcp --dport 20810 -j ACCEPT
-A INPUT -p tcp --sport 20810 -j ACCEPT

 

is that means my ports not opened ? or 

./cod4.sh command executed wrongly 
 

Share this post


Link to post
Share on other sites
5 minutes ago, swamy said:

#!/bin/bash

screen -dmS cod4 ./cod4x18_dedrun +set dedicated 2 +set net_ip 35.200.163.161 +set net_port 28960 +set sv_hostname new ubuntu server  +map mp_backlot

is this correct?

edited this cod4.sh 

 

Not sure on the screen side of things, I usually create the session (tmux in my case) then run the cod4x dedrun via a script (the ./cod4x18_dedrun blah blah) but yes you would be correct generally.

Make sure cod4x18_dedrun is executable

Also, make sure you have quotations around your servername
+set sv_hostname "New Server"

never tested without quotations but i suspect it will cause issues but thats just a guess.

Share this post


Link to post
Share on other sites
5 minutes ago, Koaja said:

Also, make sure you have quotations around your servername
+set sv_hostname "New Server"

#!/bin/bash

screen -dmS cod4 ./cod4x18_dedrun +set dedicated " 2" +set net_ip "10.160.0.2" +set net_port" 28960" +set sv_hostname" new ubuntu server " +map mp_backlot

and same results not able to connect server .... I drought if server started or ports not opened

 

Share this post


Link to post
Share on other sites
Just now, swamy said:

#!/bin/bash

screen -dmS cod4 ./cod4x18_dedrun +set dedicated " 2" +set net_ip "10.160.0.2" +set net_port" 28960" +set sv_hostname" new ubuntu server " +map mp_backlot

and same results not able to connect server .... I drought if server started or ports not opened

 

Remove the screen bits, and just try ./cod4x18_dedrun blah blah, see if it runs at least. We can create a screen session later if this works,.

 

Edited by Koaja

Share this post


Link to post
Share on other sites

root@sds:~/cod4$ ./cod4.sh

./cod4.sh: line 2: ./cod4x18_dedrun: Permission denied

root@sds:~/cod4$ sudo ./cod4.sh

./cod4.sh: line 2: ./cod4x18_dedrun: Permission denied

Share this post


Link to post
Share on other sites

chmod +x cod4x18_dedrun

then run the script

Edited by Koaja

Share this post


Link to post
Share on other sites
4 minutes ago, swamy said:

thanks bro I love you it woking

 

Awesome, create the screen session seperately (or retest with your screen dMs stuff) and attach to it and run the cod4 server. Glad it helped

Share this post


Link to post
Share on other sites
1 minute ago, swamy said:

how to stop server now ? I added screen -dmS cod4

 

 

attach to your screen session (I dont use screen so I dont know sorry) and ctrl c on your cod4 window

  • Sad 1

Share this post


Link to post
Share on other sites

now 1 question how to create server with mods

#!/bin/bash

./cod4x18_dedrun +set dedicated " 2" +set net_ip "10.160.0.2" +set net_port" 28960" +set fs_game "mods/gungame" +exec server.cfg +map mp_backlot

correct?

I did like this  and coming  

bash: ./gungame.sh: Permission denied

Share this post


Link to post
Share on other sites

I tested a same code with cod4.sh it works ... I drought other name.sh wont work?

is it?

any solution if I want different name.sh to work?

Share this post


Link to post
Share on other sites
1 hour ago, swamy said:

I tested a same code with cod4.sh it works ... I drought other name.sh wont work?

is it?

any solution if I want different name.sh to work?

Is your second script executable? chmod +x gungame.sh

 

Also thanks @volkv I knew someone would know :P

Share this post


Link to post
Share on other sites

In order to execute a bash script, you have to make sure its executable first :P

 

Glad its working for you

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this